MiniMax H3 • Encode Video Stream
Turning frames into an H3 video stream the model can actually eat
- vae
- frames
- target_av
- video_latent
- frames
- width
- height
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, orloop. H3 video latents live on a17k+5frame grid.strictraises if your frame count isn't valid - no silent mangling;crop_or_pad_lasttrims/pads to fit;loopcycles your frames to fill the grid.resize_mode-none,stretch, orcenter_crop. H3 canvas has to be divisible by 32. Withnone, a non-conforming resolution raises;stretchandcenter_cropfix 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_editand 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_avso 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_avwhen you meant to use it, and your "match the timeline" encode becomes a17k+5roll 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+5frames 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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| vae | VAE | — | |
| frames | IMAGE | — | |
| frame_fit | COMBO | 3 options: strict, crop_or_pad_last, loop | |
| resize_mode | COMBO | 3 options: none, stretch, center_crop | |
| target_avopt | LATENT | Optional H3 AV latent whose video shape is the target. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| video_latent | LATENT | — |
| frames | INT | — |
| width | INT | — |
| height | INT | — |