Nodes/IAMCCS-nodes/Audio Segment Auto Planner (audio -> segmenti)
ComfyUI Node

Audio Segment Auto Planner (audio -> segmenti)

Turn any audio track into LTX-2 segment math so you don't have to

By IAMCCS·Created 11 months ago·Updated 8 days ago· 113
Audio Segment Auto Planner (audio -> segmenti)
  • audio
  • audio_duration_s
  • segment_duration_s
  • planning_mode
  • segment_preset
  • overlap_frames
  • segment_count
  • total_frames
  • unique_segment_frames
  • first_segment_raw_frames
  • continuation_raw_frames
  • last_segment_unique_frames
  • fps_out
  • report
fps25.00
split_modechoose segment count (audio / segments)
segment_count2
target_segment_seconds10
overlap_frames9
ltx_round_modeup

Long-video generation with LTX-2 is chunking: the model has a fixed native context (roughly 8n+1 frames, so 97 or 121), and anything longer means you generate in segments and stitch. The painful part isn't the sampling - it's the frame arithmetic. If you're driving the video from an audio track, you need to know how many segments your audio implies, how many frames each segment gets, and what to carry over between chunks. IAMCCS_AudioSegmentAutoPlanner does that arithmetic for you, which is exactly the kind of thing you don't want to hand-roll in an 80-node graph.

Feed it an AUDIO and an fps, and it computes the full segment plan. split_mode decides how to chunk: either "choose segment count (audio / segments)" - you pick from the segment_count presets (1, 2, 3, 4, 5, 6, 8, 10, 12) - or "choose seconds per segment (auto count)" with target_segment_seconds (5 to 30). Add overlap_frames (default 9) for the frames you'll re-use as context between segments, and ltx_round_mode (up, nearest, or down) for how to round frame counts to LTX-2's 8n+1 constraint.

Then it hands you everything you were about to compute by hand. The outputs that matter:

  • total_frames / unique_segment_frames - the whole track and how much genuinely new video each segment produces.
  • segment_count - how many chunks this plan needs.
  • first_segment_raw_frames vs continuation_raw_frames - the first segment usually differs from the rest (it has no context from a previous chunk), so they're reported separately.
  • segment_duration_s, audio_duration_s, fps_out - the numbers you'll wire into samplers and the video combine stage.

The report string is genuinely useful here: it's a plain-English recap of the plan so you can sanity-check before committing to a long generation.

Wire the outputs into the rest of an IAMCCS audio+video chain (the IAMCCS_AudioTimelineAssembler, the timeline gate, or the AU+IMG2VID helper modules), or just use the frame numbers to drive a plain sampler chain - the node doesn't care. The 9-frame default overlap is a good starting point because it matches what the LTX-2 audio-guided extension workflows tend to use; you'll raise it if you see seams between segments, lower it if your VRAM is complaining.

Installing it: it's part of IAMCCS/IAMCCS-nodes. ComfyUI Manager → search "IAMCCS" and install, or cd ComfyUI/custom_nodes && git clone https://github.com/IAMCCS/IAMCCS-nodes.git and restart. No model downloads, no extra dependencies - it's pure frame math over the AUDIO object ComfyUI already gives you.

Two gotchas. First, don't treat segment_count as a hard contract: it's derived from your chosen split mode, so if you pick "count" mode and your audio is 3 seconds long with 12 segments, you'll get segments shorter than the model wants - read segment_duration_s and adjust. Second, ltx_round_mode only matters if you're actually generating with LTX-2's 8n+1 constraint; if you're building for a different backend, nearest is a safer default than up, which tends to round every segment upward and silently inflate your total duration.

CategoryIAMCCS/LTX-2

Inputs (7)

NameTypeDefaultDescription
audioAUDIO
fpsFLOAT25.000.001–240
split_modeCOMBOchoose segment count (audio / segments)2 options: choose segment count (audio / segments), choose seconds per segment (auto count)
segment_countCOMBO29 options: 1, 2, 3, 4, 5, 6, +3
target_segment_secondsCOMBO107 options: 5, 8, 10, 12, 15, 20, +1
overlap_framesINT90–4096
ltx_round_modeCOMBOup3 options: up, nearest, down

Outputs (13)

NameTypeDescription
audio_duration_sFLOAT
segment_duration_sFLOAT
planning_modeSTRING
segment_presetSTRING
overlap_framesINT
segment_countINT
total_framesINT
unique_segment_framesINT
first_segment_raw_framesINT
continuation_raw_framesINT
last_segment_unique_framesINT
fps_outFLOAT
reportSTRING