Nodes/ComfyUI-MiniMaxH3-Contex-Loop/MiniMax H3 Contex Loop Context
ComfyUI Node

MiniMax H3 Contex Loop Context

Where your previous scene's motion and audio actually get carried over

By ethanfel·Created 17 days ago·Updated about 20 hours ago· 315
MiniMax H3 Contex Loop Context
  • state
  • conditioning
  • vae
  • latent
  • audio_vae
  • model
  • drift_sigmas
  • conditioning
  • trim_frames
  • is_continuation
  • latent
  • model

MiniMax H3 Contex Loop Context is the heart of the continuity system. Everything the loop promises - "your character still looks like the same person in scene four," "the room tone carries," "the camera doesn't reset" - comes down to what this node injects into the conditioning and latent before each scene samples. If you're going to understand one node in this pack deeply, make it this one.

It sits between the stock MiniMax H3 Ref2VA/I2V conditioning node and your sampler. In scene one it's a pass-through: no predecessor exists, so your conditioning goes through untouched. From scene two on, it applies whatever context the Plan and Chain Policy called for - the saved video tail as guide rows, or an AV-mask mode where the previous tail is VAE-encoded into the target latent and protected from denoising.

The inputs

  • state - from Current Shot. This is the scene bookkeeping: which scene is rendering, what the Plan resolved.
  • conditioning - from the stock H3 node. Scene 1 passes through; later scenes get the saved continuation context attached.
  • vae - the H3 video VAE, used to encode saved context frames for continuation scenes.
  • latent - the current scene's empty AV latent from the stock conditioning node. In guide mode it passes through; in AV-mask modes it comes back as a masked preserved-prefix copy.
  • audio_vae (optional) - the H3 audio VAE, required when scene 1 continues from imported audio or when Chain Policy locks source-audio windows into the target latent. You can leave it disconnected only if neither behavior is active.
  • model and drift_sigmas (optional) - only for Drift-Control AV and Color-Stable Drift AV. For a single-model sampler, connect one H3 MODEL here. For a sigma split that switches models mid-schedule, leave MODEL disconnected, connect the full drift_sigmas schedule, and put a Drift-Control Model Patch on each raw model branch.

The outputs that matter

  • conditioning - sampler-ready. Connect to the H3 guider.
  • trim_frames - the repeated leading frames to strip after decoding. This is the number that keeps your delivered scenes the right length; wire it to MiniMax H3 Contex Loop Trim.
  • latent - the sampler-ready target latent. In AV-mask modes this is where the preserved video prefix lives, and with Lock source audio it carries the complete scene-local audio stream even in Guide/Cut modes. Wire this output to the sampler, not the original latent.
  • is_continuation - a BOOLEAN that's true whenever preceding video or generated audio is carried, including audio-only guide continuation. Handy for a conditional in the graph, but honestly most people use it for debugging.
  • model - the H3 MODEL, patched only while a Drift-Control AV mode is active; otherwise your connected model passes through unchanged.

The honest read

For a normal first run you don't touch much: connect state, conditioning, the video VAE, and the current latent, and let the Chain Policy drive the modes. Where people get burned is mixing up the two VAEs - the video VAE goes in vae, the audio VAE in audio_vae, and swapping them produces the kind of nonsense decode that's genuinely hard to diagnose. Also note the latent output: in 0.5 you must wire the sampler to the returned latent so the Plan can switch modes safely, not the original one.

Installing it

Ships in ComfyUI-MiniMaxH3-Contex-Loop (ComfyUI Manager: "MiniMax H3 Contex Loop"), or:

cd ComfyUI/custom_nodes && git clone https://github.com/ethanfel/ComfyUI-MiniMaxH3-Contex-Loop.git

Restart ComfyUI. You need the H3 model weights and a current ComfyUI build with native Add Guide support (PR #15439). ffmpeg is preferred for the review/assembly steps around it; PyAV works as fallback.

Common issues

Besides the VAE swap above, the classic failure is an AV-mask mode with a context_length that doesn't hit the AV clock. The Plan tooltip is blunt: use 22 for guide mode and 39 for masked/tapered/feathered AV so the clocks meet exactly. If a scene comes out with a frozen-looking head or the wrong duration, check context_length, trim_frames wiring, and whether Chain Context's latent output actually reaches the sampler.

Categoryconditioning/minimax/contex_loop

Inputs (7)

NameTypeDefaultDescription
stateH3_CHAIN_STATECurrent state from H3 Chain Current Shot.
conditioningCONDITIONINGConditioning from the stock MiniMax H3 Ref2VA/I2V node. Scene 1 passes through without motion context; later scenes receive the saved continuation context.
vaeVAEMiniMax H3 video VAE used to encode saved context frames for continuation scenes.
latentLATENTThe CURRENT scene's empty AV latent from the stock H3 conditioning node. Chain Context passes it through in guide mode or returns a masked preserved-prefix copy in an AV mask mode.
audio_vaeoptVAEH3 audio VAE used when scene 1 continues from imported audio or when Chain Policy locks each source-audio window into the target latent. It may be left disconnected only when neither behavior is active.
modeloptMODELRequired by Drift-Control AV and Color-Stable Drift AV. Connect one MiniMax H3 MODEL here for a single-model sampler. For a sigma split that switches models, leave this disconnected, connect the full drift_sigmas schedule, and put one Drift-Control Model Patch on EACH raw model branch. Other modes pass a connected MODEL through unchanged.
drift_sigmasoptSIGMASOptional original FULL sigma schedule before any split. Connect it for either Drift AV when sampling is divided across stages so both model branches use one canonical next-sigma schedule. This also selects the external per-model patch route when Chain Context's MODEL input is disconnected.

Outputs (5)

NameTypeDescription
conditioningCONDITIONINGConditioning ready for the H3 guider/sampler: scene 1 passes through unless Existing Video Context seeds it; later scenes use their effective video and/or generated-audio context.
trim_framesINTRepeated leading frames to remove after decoding. Connect to MiniMax H3 Contex Loop Trim.
is_continuationBOOLEANTrue when preceding video or generated audio is carried, including audio-only guide continuation; false for a fully independent scene.
latentLATENTSampler-ready target latent. With Lock source audio, its complete scene-local audio stream is source encoded and protected even in Guide/Cut modes. AV mask modes additionally preserve the selected video prefix. Wire this output to the sampler so Plan can switch safely.
modelMODELH3 MODEL patched only while either Drift-Control AV mode is active; otherwise the optional input MODEL passes through unchanged. This is None on the external sigma-split route, where each raw model instead passes through its own Drift-Control Model Patch.