H3 Motion Context
The node that makes H3 clips actually continue each other
- conditioning
- vae
- latent
- context_frames
- context_latent
- audio_vae
- context_audio
- conditioning
- trim_frames
You made a great MiniMax H3 clip and you want the next one to pick up where it left off: same motion, same speed, same direction, and the soundtrack continuing rather than a new take that merely sounds similar. LTX has clip chaining built in. H3 doesn't, but the parts were already there - H3 can pin a frame at a time coordinate and re-inject it at every sampling step as never-denoised conditioning rows. The only thing stopping a whole run of frames was one check in ComfyUI that rejected any pinned frame other than the first or last. This node lifts that check. That's the whole trick, and it's a good one.
The pack patches ComfyUI at runtime, and the patches only install the first time a Motion Context node runs - having it installed changes nothing about your other H3 workflows. It works identically on ComfyUI 0.32 and 0.33. Worth knowing: 0.33 lifted the interior-anchor restriction upstream and added an "Add Guide for MiniMax H3" node. If all you need is anchoring an image, clip, or audio at some frame, use that. What's left here is the previous clip's tail sliced straight out of its latent (no decode or re-encode - the source of colour drift down a chain), and audio pinned so the model continues your soundtrack instead of starting a sound-alike.
The audio half is the more useful half, because H3 generates picture and sound together. Early versions routed pinned audio through H3's reference mechanism, and every join ticked - cross-correlation showed the new clip was a cover band: same instruments, never the same recording. The fix rewrote the pinned audio's coordinates onto the new clip's timeline, and join correlation went from ~0.45 to 0.95+.
Wiring
Put the node between MiniMaxH3ImageToVideo / MiniMaxH3ReferenceToVideo (or the t2v path) and your guider/sampler:
MiniMaxH3ImageToVideo -> H3 Motion Context <- previous clip's latent
-> guider / sampler -> ... -> H3 Motion Context Trim -> Create Video
Wire conditioning, vae, and latent in. The conditioning output feeds your guider or sampler; trim_frames feeds the Trim node - the pinned head comes back at the start of the clip and has to come off before you concatenate, picture and sound.
Two inputs matter. context_length is how many frames of the previous clip's picture to carry over; only 5, 22, 39, or 56 are offered, because those are the lengths that come out to a whole number of latent steps. Use 22. 5 is just barely fluid, 22 is nearly seamless, and 56 spends 2.3 seconds of every render on frames you throw away. audio_context_length sets how far back the pinned sound reaches, independent of the picture window - use 24, exactly one second and precisely on H3's 40 Hz audio grid. Zero follows the picture window.
context_latent is the star input: the previous clip's sampler-output latent supplies both picture and sound, sliced straight out, skipping the decode/re-encode that costs quality at every link. You can't wire the sampler straight into it (ComfyUI correctly calls that circular), so it crosses runs through a file via the pack's Save/Load Latent pair. Leave it unwired for clip 1. Resolution must match between clips - a latent can't be resized, and the node refuses rather than quietly taking the lossy path. The older context_frames + context_audio + audio_vae path works but adds a lossy round trip per link - where visible seams came from. Use the latent.
Install
Drop the folder in ComfyUI/custom_nodes and restart, or use ComfyUI Manager and search "H3 Motion Context":
cd ComfyUI/custom_nodes
git clone https://github.com/NikoDemon80/ComfyUI-H3-Motion-Context
# restart ComfyUI
The pack is pure Python - no model files, no heavy dependencies. You do need H3 itself (the 33B MiniMaxAI/MiniMax-H3 weights; consumer cards run the int8 convrot quant variants from the example workflows), and one legal check before you ship anything: the H3 community license reportedly doesn't cover the EU, UK, Korea, or the US.
Common issues
Only install this once. Several H3 packs lift the same first/last keyframe restriction independently, and only one can own that code - if another got there first, this node says so and refuses. A renamed folder still counts as installed.
Keep Spectrum (ComfyUI-Spectrum-MiniMax-H3) off for these graphs - step-skipping optimizers mispredict the pinned rows and dull the audio, and turbo LoRAs cost you audio the same way. Quality degrades down a long chain (audio top end goes first, picture holds up much better), and prompting a chain takes work: hold clip N's exact closing framing for about two seconds with no dialogue before cutting to the new setup, and don't describe a different arrangement of people next - H3 renders contradictions as unions, and the pinned frames aren't a suggestion. It's the pack you reach for when a long H3 sequence has to actually hang together.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| conditioning | CONDITIONING | — | |
| vae | VAE | — | |
| latent | LATENT | — | |
| context_length | COMBO | 22 | Frames of the previous clip's picture to carry over. Only these lengths are whole numbers of latent steps, so only these are offered. 5 is just barely fluid, 22 is nearly seamless. Longer windows pin more motion but come off the front of the delivered clip, so 56 spends 2.3 seconds of the render on frames you throw away. |
| audio_context_length | INT | 240–240 | Frames of tail audio to pin, independent of the picture window. 0 follows it. The window is END-aligned with the pinned video, so this only controls how far back the sound reaches. Multiples of 3 land exactly on the 40 Hz audio grid and multiples of 24 are whole seconds: 24 pins the last second. Off-grid values are widened to the nearest whole step. |
| context_framesopt | IMAGE | Decoded frames of the previous clip. Used when no context_latent is wired. When one is, the picture comes from it instead and this is ignored. | |
| context_latentopt | LATENT | Previous clip's SAMPLER OUTPUT latent (the same one you wire into the decode nodes). Supplies both picture and sound, sliced straight out, skipping the decode and re-encode that cost a little quality at every link of a chain. Must be the same resolution as the clip being generated. | |
| audio_vaeopt | VAE | H3 audio VAE. Supply with context_audio to carry the previous clip's tail sound across the join. Not needed when context_latent is wired. | |
| context_audioopt | AUDIO | Audio of the previous clip. The tail matching the pinned frames is encoded and pinned alongside them. Ignored when context_latent is wired. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| conditioning | CONDITIONING | — |
| trim_frames | INT | — |