Nodes/ComfyUI-JZL-MiniMax-H3/JZL - 🎬 MiniMax H3 二采编码
ComfyUI Node

JZL - 🎬 MiniMax H3 二采编码

Encode both passes at once — first-pass latent plus a second-pass conditioning

By wjluoxiao·Created 13 days ago·Updated 3 days ago· 57
JZL - 🎬 MiniMax H3 二采编码
  • clip
  • vae
  • first_frame
  • last_frame
  • positive
  • LATENT
  • positive_2
prompt
width1344
height768
length124
upscale_scale1.00

"JZL - 🎬 MiniMax H3 二采编码" (Dual Encode) is the one-stop encoder for the two-pass H3 workflow: it encodes your prompt - with optional first/last frames - and hands you both the first-pass conditioning and a second-pass conditioning, in a single run. One node, three outputs: positive (pass one), LATENT (the empty AV latent), and positive_2 (pass two, re-encoded at the upscaled resolution). No extra encode pass to wire up by hand, and - this is the point - no silently reusing a low-res conditioning that misaligns the first frame.

It's the fl2va/t2va counterpart to the pack's ref2va "参考编码" node. Reach for it when you plan to upscale the latent and sample again.

How it works

For the first pass it reproduces the official MiniMaxH3ImageToVideo encoding logic: it builds an empty AV latent at width/height/length, encodes the prompt text, and if you supplied first_frame/last_frame it resizes them to the canvas, VAE-encodes them, and attaches them as minimax_keyframes (at frame indices 0 and frame_count-1) plus the frame count.

Then the dual part: if upscale_scale > 1.0, it computes the second-pass canvas (width × scale, height × scale, aligned to 32) and runs the entire encode again at that larger resolution - text tokens and first/last-frame visual tokens all re-encoded. That re-encode is exactly why the second pass starts from a clean, correctly-sized conditioning instead of a reused low-res one. If upscale_scale is 1.0, positive_2 is just a copy of positive (no second pass).

The inputs that matter

  • prompt - the H3 prompt text.
  • first_frame / last_frame - optional images for image-to-video or first-last-frame video.
  • length - frame count at 24fps, snapped to the model's 17k+5 grid; default 124 ≈ 5s.
  • upscale_scale - the second-pass multiplier (1.0–4.0). Must match the align of your latent upscaler.

Outputs: positive, LATENT, positive_2. Typical wiring: positive+LATENT → first sampler → latent upscaler → JZL_MiniMaxH3CondSync (or straight on) with positive_2 for the second sampler.

How to install it

Part of the JZL-MiniMax-H3 pack - ComfyUI Manager, search "ComfyUI-JZL-MiniMax-H3", or:

cd ComfyUI/custom_nodes
git clone https://github.com/wjluoxiao/ComfyUI-JZL-MiniMax-H3

Restart. It's an io.Schema V3 node, so it needs a recent ComfyUI with comfy_api.latest, plus torch/torchaudio for the audio-VAE side of the pack.

Common issues

The number one mistake is mismatched multipliers: upscale_scale here has to agree with your latent upscaler's actual scale, or positive_2 won't match the upscaled latent's shape and the second sampler errors out or smears. Also keep first_frame/last_frame off unless you actually want them - a stray first-frame image re-encoded at 2× resolution is wasted compute. And the standing H3 caveat: weights are ~42.5GB and the MiniMax H3 Community License excludes the US, EU, UK, and South Korea from local runs.

CategoryJZL/MiniMax

Inputs (9)

NameTypeDefaultDescription
clipCLIP
vaeVAE
promptSTRING
widthINT134432–16384
heightINT76832–16384
lengthINT1245–360024fps 帧数,吸附到模型 17k+5 网格(124 ≈ 5s,训练区间约 124-362)
upscale_scaleFLOAT1.001–4二采分辨率 = 一段分辨率 × 倍数(对齐 32,需与 latent 放大节点的 align 一致)。1.0 = 不二采。
first_frameoptIMAGE首帧图(图生视频)
last_frameoptIMAGE尾帧图(首尾帧生视频)

Outputs (3)

NameTypeDescription
positiveCONDITIONING
LATENTLATENT
positive_2CONDITIONING