Nodes/MiniMax H3 Planner/H3 Stitch Timeline
ComfyUI Node

H3 Stitch Timeline

Trim every clip back to plan and join it in one ffmpeg pass

By AIJigyasa·Created 22 days ago·Updated 19 days ago· 4
H3 Stitch Timeline
  • project
  • timeline
  • music_track
  • video_path
  • contact_sheet_path
  • duration
  • report
  • video
◄preferchosen►
◄trim_to_plantrue►
◄filename_prefixh3planner►
◄min_clips2►
◄contact_sheettrue►
◄audiofrom clips►

The last problem with long video is the one nobody plans for: it doesn't line up. H3 renders on a 17-frame ladder and always overshoots, so a twelve-segment piece with 0.6s of overshoot per clip ends up nearly 8 seconds longer than you planned - and if there's music under it, the last chorus is somewhere else entirely.

H3 Stitch Timeline resolves each segment's clip, trims it back to its planned duration, and joins the lot in a single ffmpeg pass. Frame accurate, and on files, never image tensors.

What that means in practice

It walks the timeline, asks the vault for the best clip for each segment, and cuts each one down to target_duration - the musical or authored length you planned in, not the rung H3 actually rendered. Then one concat call produces the mp4. That trim is the whole point, and it's why the Beat Map can put cuts on the millisecond while H3 only renders whole ladders of frames.

The canvas is the largest clip present, not the current pass. A half-promoted timeline with 0.3 MP drafts and 1.2 MP finals stitched together doesn't get its finals downscaled to match the drafts.

It also writes a contact sheet - a grid of segment thumbnails - which is the fastest way to see whether the piece has a shape.

There's no decode-to-frames stage anywhere. For a three-minute render that would be many gigabytes of memory for a file that already exists. The video output is a native VIDEO object: wire it to Save Video or Preview Video.

Inputs

project and timeline in, then:

  • prefer - chosen, final or draft. Set it to final or draft and the node waits for clips of that pass, so a final stitch doesn't quietly join drafts. Anything that fell back gets named under MIXED PASSES.
  • min_clips - how many clips to wait for. 0 means every segment in the timeline, so you can leave this node wired into the render graph and it stitches itself the moment the last card finishes. H3 Timeline's segment_count output wires straight in and keeps the number in step for you.
  • trim_to_plan - on. Turning it off keeps H3's overshoot and the report says so: expect drift against your audio.
  • audio - from clips (each clip's own generated audio), from track (lays the original reference track over the whole thing), or silent. For a music video from track is what keeps it in sync and at full quality. It needs music_track wired from the Cast Board, or the node raises rather than guessing.
  • contact_sheet, filename_prefix.

Outputs: video_path, contact_sheet_path, duration, report, video. Everything lands in output/h3_planner/<project>/renders/.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/AIJigyasa/ComfyUI-H3-Planner

Restart, or install MiniMax H3 Planner from ComfyUI Manager. ffmpeg is the hard requirement here - put it on PATH, or pip install imageio-ffmpeg into the ComfyUI environment and the pack will find that binary. If neither exists the node tells you exactly that instead of failing somewhere deep in a subprocess.

Where people get burned

The report has three sections worth reading every time. MISSING is segments with no clip at all. OUT OF SYNC means a stored clip is shorter than the plan - almost always because you changed a segment's duration after rendering it, so the cut will run short and everything after it slides early. Redo that card. MIXED PASSES means you asked for finals and some segments only have drafts.

It won't error just because there's nothing to join. This node usually sits in the render graph, so on the first queue there is nothing to stitch yet - that's normal, not a failure. It waits until min_clips are ready, blocks the branch so whatever is wired to video doesn't run on a dead output, and re-stitches on every queue as clips arrive. A growing preview instead of a crash.

Stitching before you're done is fine; stitching the wrong pass is not. If you switch H3 Project to final and forget to give those segments a second H3 Vault Write on the upscale branch, you'll have one pass name in the graph and your "finals" will be drafts with a promotion story attached. See H3 Pass Gate.

CategoryH3 Planner

Inputs (9)

NameTypeDefaultDescription
projectH3_PROJECT—
timelineH3_TIMELINE—
preferCOMBOchosen3 options: chosen, final, draft
trim_to_planBOOLEANtrueoff = keep H3's ladder overshoot; sync will drift
filename_prefixSTRINGh3planner—
min_clipsINT20–999wait quietly until this many segments have rendered. Leaving the node in the render graph then stitches a growing preview instead of erroring on the first run. 0 = wait for EVERY segment in the timeline, so it stitches itself the moment the last card is done. With prefer set to draft or final it counts only clips of THAT pass, so a final stitch waits for finals instead of joining drafts.
contact_sheetBOOLEANtrue—
audioCOMBOfrom clipsfrom track lays the original reference audio over the whole video — for a music video that is what keeps it in sync and at full quality
music_trackoptAUDIOthe full reference track, straight off the Cast Board

Outputs (5)

NameTypeDescription
video_pathSTRING—
contact_sheet_pathSTRING—
durationFLOAT—
reportSTRING—
videoVIDEO—