Motion Context: chain H3 clips into a longer video — MiniMax H3 tutorial
Install Motion Context, carry the previous audio-video latent into the next generation, and complete a two-clip chain with continuous picture and sound.
Audience: ComfyUI users with a stable single-clip H3 workflow who need longer sequences without obvious picture seams or restarted audio.
Hardware: An NVIDIA setup that already runs H3 reliably. Both clips must use identical resolution; validate with short native-sampling clips first.
Prerequisites
- A working T2V, I2V, or Ref2VA H3 ComfyUI workflow
- ComfyUI 0.32 or 0.33, with compatibility rechecked after updates
- The first clip's complete latent plus decoded picture and audio
- Two planned prompts whose second opening preserves the first clip's closing composition and relationships
Steps
- Clone ComfyUI-H3-Motion-Context into ComfyUI/custom_nodes/ and restart. The console should report h3_motion_context: nodes registered. Remove duplicate installs or another pack that owns the same patch when it reports a conflict.
- Duplicate the working H3 graph for long-video experiments. Route H3 conditioning into H3 Motion Context and its output back to the guider or sampler, leaving the original baseline untouched.
- Add H3 Motion Context Save Latent after the sampler. Set Save clip_index=1 for clip one and leave context_latent disconnected. Generate clip one and retain its decoded IMAGE, AUDIO, and latent.
- For clip two, add H3 Motion Context Load Latent with Load clip_index=1 and connect its output only to Motion Context context_latent. Do not decode it or replace these nodes with stock Save/Load Latent, which cannot carry H3's paired video-audio latent.
- Also route the current clip-two sampler output to Save Latent with Save clip_index=2. A retry still loads clip one and overwrites clip two; after approval, advance both indices together.
- Route decoded IMAGE and AUDIO through H3 Motion Context Trim and connect trim_frames from Motion Context. Trim both picture and sound or the pinned context repeats at the new clip's beginning.
- Start with context_length=22, audio_context_length=24, match_tail on, exactly the same resolution, and Spectrum off. A 22-frame head removes about 0.92 seconds from delivered clip two.
- Open the second prompt by holding the prior closing composition for about two seconds. Do not immediately change rooms or add people; include a breath, weight shift, or eyeline move to avoid a frozen hold, then introduce the new shot.
- After rendering clip two, compare untrimmed and trimmed output for picture seams, motion direction, audio waveform or beat, and loudness. Concatenate only after the join passes.
- For clip three, load index 2 and save index 3. Listen critically as the chain grows because audio high frequencies can soften; restart the chain at a natural musical transition instead of continuing forever.
Commands
cd ComfyUI/custom_nodes
git clone https://github.com/NikoDemon80/ComfyUI-H3-Motion-Context
git -C ComfyUI-H3-Motion-Context pull
python ComfyUI-H3-Motion-Context/tests/_mock_harness.py
python ComfyUI-H3-Motion-Context/tests/_node_smoke_test.py
Caveats
- Use this project's Save/Load Latent nodes; stock ComfyUI nodes cannot store H3's paired audio-video latent.
- Latents cannot be resized, so a resolution mismatch is rejected. Start a new chain when changing resolution.
- Model smoothing compounds down a chain, especially in audio high frequencies. Plan natural points to restart long sequences.
- Turbo and Spectrum both reduce audio detail and stack badly. Keep Spectrum off for this baseline.
- ComfyUI updates can change stored widget positions. After an upgrade, delete old Motion Context nodes, add them again, and rewire.
View original source · NikoDemon80 · 2026-08-23