Nodes/H3 Motion Context/H3 Motion Context
ComfyUI Node

H3 Motion Context

The node that makes H3 clips actually continue each other

By NikoDemon80·Created 4 months ago·Updated 5 days ago· 1,466
H3 Motion Context
  • conditioning
  • vae
  • latent
  • context_frames
  • context_latent
  • audio_vae
  • context_audio
  • conditioning
  • trim_frames
  • latent
  • geiru_drop
◄context_length22►
◄audio_context_length18►
◄holdpinned►
◄geiru_dropfalse►
◄sound_release12►

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.

Categoryconditioning/minimax

Inputs (12)

NameTypeDefaultDescription
conditioningCONDITIONINGFrom your H3 conditioning node (Reference to Video, Image to Video or Text to Video).
vaeVAEThe H3 video VAE. Only used when the previous clip comes in as frames instead of a latent.
latentLATENTThe empty latent for this clip, the one you would normally wire into the sampler.
context_lengthCOMBO22How many frames of the previous clip to carry over. 22 joins almost seamlessly. 39 and 56 carry more motion. These frames are trimmed off the finished clip, so longer costs render time.
audio_context_lengthINT180–240Pinned hold only. How much of the previous clip's sound to carry over, in frames. 18 is the best balance. Longer muffles the sound a little more at each join; shorter lets music wander. 0 matches context_length.
holdCOMBOpinnedHow the previous clip's frames are carried over. pinned: the default. masked: the frames are placed straight into this clip and locked, so nothing is redrawn and it costs no extra time. masked needs context_latent wired, and this node's latent output wired into the sampler instead of the empty latent. Masked hold is Roycho's method, from seitanism's MultiRef.
geiru_dropBOOLEANfalseOn: skips the previous clip's last 17 frames and carries over the frames just before them. H3's last frames come out slightly degraded, and skipping them stops the background drifting after the join. Trim and Chain Upscale follow this setting through the geiru_drop output. From Roycho's Geiru Context.
sound_releaseINT120–64Masked hold only. How gently the carried sound hands over to the new sound. Stops pops on noisy sound like water or wind. 12 is the default, 0 switches at once. Only works with Geiru drop on; with it off there is no room and the sound switches at once.
context_framesoptIMAGEThe previous clip's frames, if you chain from frames instead of a latent. Pinned hold only. Ignored when context_latent is wired.
context_latentoptLATENTThe previous clip's latent, from Load Latent. The best way to chain: picture and sound come straight from it with no quality lost. Must be the same size as this clip.
audio_vaeoptVAEThe H3 audio VAE. Only needed with context_audio.
context_audiooptAUDIOThe previous clip's sound, if you chain from frames. Ignored when context_latent is wired.

Outputs (4)

NameTypeDescription
conditioningCONDITIONINGInto the guider or sampler.
trim_framesINTHow many frames were carried over. Wire it into Trim, Save Latent's pin_frames, and Join Match or Sparse Hold if you use them.
latentLATENTMasked hold: wire this into the sampler's latent_image, it carries the held frames. Pinned hold: the latent input, unchanged.
geiru_dropINTThe Geiru drop setting (17 when on, 0 when off). Wire it into Trim and Save Latent.