Nodes/IAMCCS-nodes/IAMCCS_Ltx2HelperModules Audio Timeline
ComfyUI Node

IAMCCS_Ltx2HelperModules Audio Timeline

Slice the soundtrack to match each LTX-2 segment

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
IAMCCS_Ltx2HelperModules Audio Timeline
  • audio
  • parent_contract
  • linx
  • audio_payload
  • contract
  • linx
  • conditioning_audio
  • segment_audio
  • continue_generation
  • effective_unique_frames
  • trim_frames
  • report
planner_payload{}
modeleft_context_only
left_overlap_s0.50
right_overlap_s0.00
clamp_policysoft_clamp
min_next_frames1

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: PlannerAudioTimeline → (segment sampling) → Continuity/DiskExtensionFinalize.

How it works

Given the planner_payload (segment boundaries, fps, trim info) and your master audio, it walks the timeline cursor forward and:

  1. 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).
  2. 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, or no_overlap.
  3. Outputs two audio streams: conditioning_audio (the slice with context, fed to the LTX audio conditioning) and segment_audio (the clean slice for this segment only, for final muxing).
  4. Decides whether to keep going - continue_generation (BOOLEAN) comes from the timeline gate: when the audio is nearly exhausted or the remaining frames fall below min_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.

CategoryIAMCCS/Ltx2 Helper Modules

Inputs (9)

NameTypeDefaultDescription
planner_payloadSTRING{}
audioAUDIO
modeCOMBOleft_context_only4 options: left_context_only, right_context_only, symmetric_context, no_overlap
left_overlap_sFLOAT0.500–30
right_overlap_sFLOAT0.000–30
clamp_policyCOMBOsoft_clamp2 options: soft_clamp, strict
min_next_framesINT11–100000
parent_contractoptIAMCCS_SUPERNODE_CONTRACT
linxoptIAMCCS_SUPERNODE_LINX

Outputs (9)

NameTypeDescription
audio_payloadSTRING
contractIAMCCS_SUPERNODE_CONTRACT
linxIAMCCS_SUPERNODE_LINX
conditioning_audioAUDIO
segment_audioAUDIO
continue_generationBOOLEAN
effective_unique_framesINT
trim_framesINT
reportSTRING