ComfyUI Node

H3 Auto Chain Audio

The conductor that decides where every clip starts and ends

By Ltamann·Created 23 days ago·Updated 14 days ago· 39
H3 Auto Chain Audio
  • audio
  • ref_video
  • audio
  • chunk_seconds
  • clip_index
  • chain_id
  • prompt
  • chain_config
  • source_audio
  • ref_video
  • frames
  • fps
chain_idh3_auto_chain
chunk_seconds20.0
fps24
trim_frames22
final_tail_modeexact audio duration
final_tail_frames24
resettrue
style_prompt
clip_prompts
start_clip1
end_clip0
endless_continuationfalse

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 in style_prompt and applies to every clip. Per-clip actions go in clip_prompts as 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_clip of 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_id mismatch. Keep one H3 Auto Chain Audio per workflow.
  • "Chain has already finished" - the previous run consumed all the audio and the in-memory state is stale. Enable reset and queue again.
  • Prompts not applying - the [1] tags must start a line in clip_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.

Categoryconditioning/minimax

Inputs (14)

NameTypeDefaultDescription
audioAUDIOComplete audio for the entire automatic chain. The node outputs one sequential chunk per run.
chain_idSTRINGh3_auto_chainUnique name for this chain. It identifies the saved latents, clips, and final video.
chunk_secondsFLOAT20.01–600Target duration of each clip. The final chunk may be shorter.
fpsINT241–240Frame rate of the chain timeline. Audio cuts, video windows, trimming, and stitched clips use this same frame grid.
trim_framesINT220–4096H3 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_modeCOMBOexact audio durationFinal 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_framesINT240–4096Silent frames retained after the source audio ends when audio plus tail is selected.
resetBOOLEANtrueStart a new chain from the node settings. When false, resume using the saved latent.
style_promptSTRINGShared style, character, lighting, camera, and appearance text added to every clip prompt.
clip_promptsSTRINGWrite one tagged prompt per clip: [1] prompt for clip 1, [2] prompt for clip 2, and so on. Tags must start a line.
start_clipINT11–9999First clip to process. To resume after clips 1 and 2, set this to 3.
end_clipINT00–9999Last clip to process. 0 means continue until the audio ends.
endless_continuationBOOLEANfalseUse the previous clip's synchronized video/audio tail as an H3 continuation reference, like HR Endless Sampler. Off preserves the current chain.
ref_videooptIMAGEOptional 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)

NameTypeDescription
audioAUDIO
chunk_secondsFLOAT
clip_indexINT
chain_idSTRING
promptSTRING
chain_configH3_CHAIN
source_audioAUDIO
ref_videoIMAGE
framesINT
fpsFLOAT