H3 Auto Chain Audio
The conductor that decides where every clip starts and ends
- audio
- ref_video
- audio
- chunk_seconds
- clip_index
- chain_id
- prompt
- chain_config
- source_audio
- ref_video
- frames
- fps
If H3 Auto Chain + Stitch is the payoff, this is the conductor - the node that decides how long each clip is, which chunk of audio it gets, what prompt it renders with, and when the whole chain is over. You feed it one complete audio track and it splits it into sequential clip-sized chunks, one per run. Everything else in the pack hangs off what it decides. On a first run you get clip 1, then the workflow queues clip 2, and the audio node quietly hands out the next slice. It never calls an API and needs no key - this is all local frame math over your audio file.
How the math works
It's all frame arithmetic. With fps at 24 (the default) and chunk_seconds at 20, the audio is cut on a 480-frame grid: clip 1 takes frames 0–479, clip 2 takes 480–959, and so on. The output audio chunk is exactly the slice for the current clip, padded with silence if the source runs out early rather than asking the model for a shorter clip. That padding is deliberate - H3 renders best when every request is a full-duration clip, and the extra comes off the end. The chain_config output bundles the chain ID, clip timing, and latent slot numbers into one wire that every other node in the pack reads.
The inputs you'll actually touch
There are a lot of fields here, but only a few matter for a normal run:
chain_id- a unique name for the project. It names the latent files, the clip MP4s, and the final video. Reusing it for an unrelated project is the fastest way to corrupt a chain, and changing it mid-chain starts a new one.trim_frames- the leading frames that the Motion Context Trim node will strip off continuation clips. Default 22 (about one second at 24fps), and it should match your Motion Context context length. The addon requests this extra audio span so the trimmed clip still fills its full timeline slot.reset- start a new chain and discard the in-memory position. Enable it for a new run or a resume; it's the "I actually mean it" flag.style_prompt+clip_prompts- the shared style (lighting, wardrobe, character description) goes instyle_promptand applies to every clip. Per-clip actions go inclip_promptsas numbered lines:
[1] The character walks through a rainy city street.
[2] The character enters a warm cafe.
[3] The character looks out of the cafe window at the night traffic.
Each run the node returns the combined prompt for the current clip. That's how you get a story arc instead of twenty re-renders of the same scene.
start_clip/end_clip- where to begin (resume after clip 2? set it to 3) and where to stop.end_clipof 0 means "keep going until the audio ends."
final_tail_mode only matters for the last partial clip: exact audio duration cuts the silent tail off, audio plus tail keeps final_tail_frames of silence after the source ends.
Outputs
You get seven: the audio chunk (into your H3 video workflow), chunk_seconds, the current clip_index, the chain_id, the combined prompt (into your text-conditioning workflow), chain_config (into the other addon nodes), and source_audio (the full original track - wire this into H3 Auto Chain + Stitch's audio input for frame-aligned final audio instead of concatenated per-clip audio).
Troubleshooting
- The chain starts from clip 1 again - two chain-audio nodes in the graph, or a
chain_idmismatch. Keep oneH3 Auto Chain Audioper workflow. - "Chain has already finished" - the previous run consumed all the audio and the in-memory state is stale. Enable
resetand queue again. - Prompts not applying - the
[1]tags must start a line inclip_prompts; a tag in the middle of a sentence is just text.
Installing it is the pack install - Manager, search "H3 Motion Context", or git clone https://github.com/Ltamann/ComfyUI-H3-Motion-Context-Auto-Chain-addon into ComfyUI/custom_nodes/, then restart. You need a working MiniMax H3 workflow first, and the H3 open weights carry the usual territory caveat (Community License, excludes US/EU/UK/South Korea), so check that before you build the whole thing around it.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | Complete audio for the entire automatic chain. The node outputs one sequential chunk per run. | |
| chain_id | STRING | h3_auto_chain | Unique name for this chain. It identifies the saved latents, clips, and final video. |
| chunk_seconds | FLOAT | 20.01–600 | Target duration of each clip. The final chunk may be shorter. |
| fps | INT | 241–240 | Frame rate of the chain timeline. Audio cuts, video windows, trimming, and stitched clips use this same frame grid. |
| trim_frames | INT | 220–4096 | H3 video-context frames. Stored in chain_config and used by Motion Context and Motion Context Trim. Values snap down to the H3 VAE grid (22, 39, 56...). |
| final_tail_mode | COMBO | exact audio duration | Final partial clip output policy. Exact audio duration removes the silent tail. Audio plus tail keeps the configured silent tail after the source audio ends. |
| final_tail_frames | INT | 240–4096 | Silent frames retained after the source audio ends when audio plus tail is selected. |
| reset | BOOLEAN | true | Start a new chain from the node settings. When false, resume using the saved latent. |
| style_prompt | STRING | Shared style, character, lighting, camera, and appearance text added to every clip prompt. | |
| clip_prompts | STRING | Write one tagged prompt per clip: [1] prompt for clip 1, [2] prompt for clip 2, and so on. Tags must start a line. | |
| start_clip | INT | 11–9999 | First clip to process. To resume after clips 1 and 2, set this to 3. |
| end_clip | INT | 00–9999 | Last clip to process. 0 means continue until the audio ends. |
| endless_continuation | BOOLEAN | false | Use the previous clip's synchronized video/audio tail as an H3 continuation reference, like HR Endless Sampler. Off preserves the current chain. |
| ref_videoopt | IMAGE | Optional VHS reference video IMAGE batch. Its known VHS force rate is resampled onto the chain timeline; the longer of this video and audio sets the complete, whole-frame chain length. |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| audio | AUDIO | — |
| chunk_seconds | FLOAT | — |
| clip_index | INT | — |
| chain_id | STRING | — |
| prompt | STRING | — |
| chain_config | H3_CHAIN | — |
| source_audio | AUDIO | — |
| ref_video | IMAGE | — |
| frames | INT | — |
| fps | FLOAT | — |