APNext H3 Music Video Chain Render (carry frames between scenes)
APNext H3 Music Video Chain Render
- model
- clip
- vae
- audio_vae
- audio_segments
- sampler
- sigmas
- master_audio
- ref_image_1
- ref_image_2
- ref_image_3
- ref_image_4
- file_paths
- report
- audio
Here's the hole this node fills. When the APNext H3 Music Video Writer emits a scenes list, ComfyUI's list processing renders every scene as an independent clip - scene 3 literally cannot see scene 2's frames, because both are items of the same list. So the person in the music video changes clothes between cuts, the room rearranges, the motion restarts. Real continuity needs the previous render, not the previous prompt.
H3MusicVideoChainRender renders the writer's scenes one after another inside one execution, carrying the last context_frames of each delivered clip into the head of the next one where the take should continue. It's a dagthomas/comfyui_dagthomas node, and it does in one node what the ComfyUI-MiniMaxH3-Contex-Loop pack does with a loop - the same continuity trick, but built around the masked-song workflow the pack's own examples use.
How it works
Per scene, the node: builds the Ref2VA conditioning (up to four ref_image pictures, the same for every scene), injects the song piece into the audio latent (the "masked audio" path - the song is written into the H3 audio latent and protected from denoising, which is what gives structural lip-sync), pins the previous clip's tail to the head of the new latent when the take continues, samples with your sampler / sigmas (scene k uses seed + k), decodes, trims the pinned head and grid padding off, and saves the clip with its audio piece.
Which boundaries continue is the Cut Plan's call, if you connect one: a cut placed on a drop, section start, stop, or one of your taps stays a hard cut - that's where the sync lives - while a cut on a mere onset, downbeat, or lyric line turns into a continuing take. Or force it with continuity (flow everywhere / cut everywhere).
The continuity mechanism prefers MiniMaxH3SongMaskedAVContext from ComfyUI-H3-Motion-Context-MultiRef (the pack that also powers the masked-audio example workflows), falling back to ComfyUI core's MiniMaxH3AddGuide - picture only, audio generated - with a clear console warning.
The inputs that matter
model/clip/vae/audio_vae- from ComfyUI's MiniMax H3 loader nodes.scenes,lengths,audio_segments,clip_starts- the writer's list outputs; these are the four wires that make it a music video chain.master_audio- the whole song (Load Audio). Without it, H3 generates audio per scene.context_frames- how much of the previous clip's tail is pinned (default 22, ≈0.9 s of motion; snapped to H3's valid runs 5/22/39/56…; 39 also aligns the audio clock).carry- "previous latent" copies the sampled tail straight into the new latent (no decode/re-encode, nothing lost per link - the one you want); "previous frames" decodes and re-encodes.
Outputs: file_paths (list of saved clips), report, and audio (the joined scene audio, handy for wiring downstream).
Install
Pack plus one friend:
cd ComfyUI/custom_nodes
git clone https://github.com/dagthomas/comfyui_dagthomas
cd comfyui_dagthomas
pip install -r requirements.txt
Then install ComfyUI-H3-Motion-Context-MultiRef (Manager or git clone) for the full masked picture+sound continuity; without it the node still runs on the core guide and tells you so in the console. The H3 model itself loads through ComfyUI's own MiniMax H3 nodes - and heads-up, its weights are the big download (~40 GB+) with a community license that excludes the US, EU, UK and Korea, so check before you go all-in.
Troubleshooting
The common failure is a missing pack: connect master_audio, get a warning that continuity uses the core guide - install the Motion-Context pack and re-run. A scene piece too long to fit the pinned prefix under H3's 362-frame range opens on a hard cut with a warning instead of silently breaking, which is the kind of behavior you want. And when one scene in a finished run is wrong, don't re-run the whole chain - that's what H3 Scene Retake is for.
Inputs (25)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The H3 model, with whatever attention / SoL patches you use. | |
| clip | CLIP | — | |
| vae | VAE | H3 video VAE. | |
| audio_vae | VAE | H3 audio VAE. | |
| scenes | STRING | The writer's `scenes` list. | |
| lengths | INT | The writer's `lengths` list (frames per scene). | |
| audio_segments | AUDIO | The writer's `audio_segments` list (one song piece per scene). | |
| clip_starts | FLOAT | The writer's `clip_starts` list (seconds into the song). | |
| width | INT | 134432–8192 | — |
| height | INT | 76832–8192 | — |
| sampler | SAMPLER | — | |
| sigmas | SIGMAS | — | |
| seed | INT | 00–18446744073709550000 | Scene k samples with seed + k. |
| context_frames | INT | 225–141 | How many of the previous clip's last frames are pinned to the head of a continuing scene. Snapped to H3's valid runs (5, 22, 39, 56, ...). 22 = ~0.9 s of motion; 39 also aligns the audio clock. |
| continuity | COMBO | cut plan decides (continue over soft cuts, hard cut on drops / sections / taps) | 3 options: cut plan decides (continue over soft cuts, hard cut on drops / sections / taps), flow everywhere (one continuous take), cut everywhere (independent clips) |
| filename_prefix | STRING | video/MiniMax_H3 | — |
| fps | FLOAT | 24.001–60 | — |
| master_audioopt | AUDIO | The whole song (Load Audio). With it, every scene's audio is the song piece masked into the latent (the masked-audio workflow), and a continuing scene's pinned head carries the previous piece's tail audio too. Without it, H3 generates audio. | |
| cut_planopt | STRING | The Cut Plan text (also wired into the writer). Its `cut: ...` reasons decide which boundaries continue: onset / downbeat / lyric line continue the take, drops, section starts, stops and your taps stay hard cuts. | |
| ref_image_1opt | IMAGE | Reference picture <Picture 1> for every scene (Ref2VA). | |
| ref_image_2opt | IMAGE | Reference picture <Picture 2> for every scene (Ref2VA). | |
| ref_image_3opt | IMAGE | Reference picture <Picture 3> for every scene (Ref2VA). | |
| ref_image_4opt | IMAGE | Reference picture <Picture 4> for every scene (Ref2VA). | |
| save_latentsopt | BOOLEAN | true | Write every scene's sampled latent to output/apnext_latents/<project>_sNN.pt so H3 Scene Retake can render one scene again later, continuing from the previous scene's real tail. ~10-30 MB per scene. |
| carryopt | COMBO | previous latent (copied straight into the new latent - no decode / re-encode) | How a continuing scene gets the previous one (masked-song path). Previous latent: the sampled video latent tail is copied straight into the new latent - no decode, no re-encode, nothing lost at each link; the song stays authoritative for the sound. Previous frames: the decoded tail encoded again (the original path). |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| file_paths | STRING | — |
| report | STRING | — |
| audio | AUDIO | — |