IAMCCS_Ltx2HelperModules Audio Timeline
Slice the soundtrack to match each LTX-2 segment
- audio
- parent_contract
- linx
- audio_payload
- contract
- linx
- conditioning_audio
- segment_audio
- continue_generation
- effective_unique_frames
- trim_frames
- report
LTX-2's party trick is synchronized audio and video - but when you generate long pieces segment by segment, each segment needs its own slice of the soundtrack, plus a bit of the previous segment's audio as conditioning context so the model knows what it's continuing. Doing that slicing by hand is exactly the fiddly arithmetic the helper-module chain exists to remove. AudioTimeline does it: it takes the planner's segment plan and the master audio, and produces the right audio slices for the current segment.
It's the audio counterpart to the video-side Continuity node, and it slots into the same au_img2vid pipeline: Planner → AudioTimeline → (segment sampling) → Continuity/DiskExtension → Finalize.
How it works
Given the planner_payload (segment boundaries, fps, trim info) and your master audio, it walks the timeline cursor forward and:
- Computes the segment's audio window - the exact sample range for this segment, plus a "trim" amount that accounts for the overlap frames between video segments (audio and video don't share the same frame boundaries, so it converts carefully).
- Adds conditioning context - per
mode, it includes audio from before and/or after the segment as context:left_context_only(default - the classic: hear the previous segment's tail so the new audio starts in the right place),right_context_only,symmetric_context, orno_overlap. - Outputs two audio streams:
conditioning_audio(the slice with context, fed to the LTX audio conditioning) andsegment_audio(the clean slice for this segment only, for final muxing). - Decides whether to keep going -
continue_generation(BOOLEAN) comes from the timeline gate: when the audio is nearly exhausted or the remaining frames fall belowmin_next_frames, it flips false and the loop stops cleanly instead of generating a garbage final segment.
left_overlap_s / right_overlap_s control how much context in seconds each side gets (default 0.5 left / 0 right). clamp_policy - soft_clamp (default) trims gracefully at the audio's end; strict raises if the plan overruns the audio.
The inputs and outputs that matter
Wire in: planner_payload (from the Planner), audio (your master soundtrack), and set mode to left_context_only for extensions or no_overlap for independent clips. min_next_frames matters if you're looping - it's the floor that stops the run. Leave left_overlap_s/right_overlap_s at defaults until you hear a problem.
Outputs you'll use: conditioning_audio and segment_audio (both AUDIO), continue_generation (the loop's stop signal), effective_unique_frames and trim_frames (INTs - useful if you're cross-checking against video frames), plus audio_payload, contract, linx, and report.
Installing it
Ships in IAMCCS-nodes under IAMCCS/Ltx2 Helper Modules. Manager → "IAMCCS" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git
Restart ComfyUI. It works on standard ComfyUI AUDIO types; audio-duration planning upstream needs MTB's Audio Duration node.
Common issues
The classic failure is a loop that stops early or late - that's continue_generation doing its job, and the report STRING tells you the gate reason ("is_last_segment", remaining frames, etc.). Read it before assuming a bug. Second: if your video and audio drift apart over segments, you almost certainly set left_overlap_s too high - the conditioning context bleeds into the next segment and the model keeps "hearing" audio it shouldn't. And the overlap trim is real: trim_frames exists because the video segments overlap, and if you mux segment_audio against untrimmed video, the sync drifts by exactly that amount.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| planner_payload | STRING | {} | — |
| audio | AUDIO | — | |
| mode | COMBO | left_context_only | 4 options: left_context_only, right_context_only, symmetric_context, no_overlap |
| left_overlap_s | FLOAT | 0.500–30 | — |
| right_overlap_s | FLOAT | 0.000–30 | — |
| clamp_policy | COMBO | soft_clamp | 2 options: soft_clamp, strict |
| min_next_frames | INT | 11–100000 | — |
| parent_contractopt | IAMCCS_SUPERNODE_CONTRACT | — | |
| linxopt | IAMCCS_SUPERNODE_LINX | — |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| audio_payload | STRING | — |
| contract | IAMCCS_SUPERNODE_CONTRACT | — |
| linx | IAMCCS_SUPERNODE_LINX | — |
| conditioning_audio | AUDIO | — |
| segment_audio | AUDIO | — |
| continue_generation | BOOLEAN | — |
| effective_unique_frames | INT | — |
| trim_frames | INT | — |
| report | STRING | — |