Nodes/ComfyUI-MiniMax-H3-LongMedia/MiniMax H3 • Encode Video Stream
ComfyUI Node

MiniMax H3 • Encode Video Stream

Turning frames into an H3 video stream the model can actually eat

By vizart-vj·Created 14 days ago·Updated 2 days ago· 71
MiniMax H3 • Encode Video Stream
  • vae
  • frames
  • target_av
  • video_latent
  • frames
  • width
  • height
frame_fit
resize_mode

MiniMax H3 has its own video VAE with strict ideas about how a video should be shaped, and if you've ever fed a video model a frame count it hates, you know the drill: 500 lines of stack trace. MiniMaxH3LatentLabVideoEncode is the node that takes your plain IMAGE frames, gets them into H3's required latent format, and tells you exactly what it produced - so the model and downstream nodes never have to guess.

Inputs: vae (the H3 video VAE), frames (IMAGE batch), frame_fit, resize_mode, and an optional target_av. Outputs: video_latent, plus frames, width, height INTs describing what it actually encoded.

The settings that matter

  • frame_fit - strict, crop_or_pad_last, or loop. H3 video latents live on a 17k+5 frame grid. strict raises if your frame count isn't valid - no silent mangling; crop_or_pad_last trims/pads to fit; loop cycles your frames to fill the grid.
  • resize_mode - none, stretch, or center_crop. H3 canvas has to be divisible by 32. With none, a non-conforming resolution raises; stretch and center_crop fix it for you.
  • target_av (optional) - the killer feature. Connect an existing H3 AV latent and the encoder forces the exact canvas and temporal shape to match it. That's how you encode a reference or replacement clip that slots perfectly into a pre-existing latent - for packing and replacement you'd otherwise be fighting geometry by hand.

Why you'd reach for it

Standalone video encoders are the underappreciated half of reference-driven editing. Encode a source clip as an H3 video stream, and you can:

  • feed it to reference conditioning (video_ref_edit and friends);
  • pack it with an audio stream to build a seed AV latent;
  • encode a segment you're about to denoise or inpaint, using target_av so it matches the surrounding timeline exactly.

The frames/width/height outputs are a sanity check - wire them into a text node and you'll know exactly what shape you're working with, which saves real debugging time when a downstream node rejects the latent.

Install

One pack, no extra pip deps:

cd ComfyUI/custom_nodes
git clone https://github.com/vizart-vj/ComfyUI-MiniMax-H3-LongMedia

Restart ComfyUI, or ComfyUI Manager → "MiniMax H3 LongMedia". You need the H3 video VAE in ComfyUI's model folders (part of its native H3 support).

Gotchas

  • Forget target_av when you meant to use it, and your "match the timeline" encode becomes a 17k+5 roll of the dice. When replacing into an existing latent, always connect the target.
  • If you're coming from other video stacks, don't expect a generic VAE that accepts anything. H3's grid is 17k+5 frames and a 32-divisible canvas - that's the model, not a bug in this node.
  • The H3 weights carry the pack-wide license caveat (US, EU, UK, South Korea excluded).

A VAE encode with training wheels and honest outputs. If your references never quite line up, target_av is the answer you were missing.

CategoryMiniMax H3/LongMedia/Streams

Inputs (5)

NameTypeDefaultDescription
vaeVAE
framesIMAGE
frame_fitCOMBO3 options: strict, crop_or_pad_last, loop
resize_modeCOMBO3 options: none, stretch, center_crop
target_avoptLATENTOptional H3 AV latent whose video shape is the target.

Outputs (4)

NameTypeDescription
video_latentLATENT
framesINT
widthINT
heightINT