Nodes/IAMCCS-nodes/Segment Planner Linked (shared inputs)
ComfyUI Node

Segment Planner Linked (shared inputs)

One set of segment settings, a hundred copies of the planner — this is how

By IAMCCS·Created 12 months ago·Updated 4 days ago· 117
Segment Planner Linked (shared inputs)
    • total_frames
    • unique_segment_frames
    • first_segment_raw_frames
    • continuation_raw_frames
    • estimated_segments
    • continuation_loops
    • last_segment_unique_frames
    • report
    • segment_index_out
    • current_segment_raw_frames
    • current_segment_unique_frames
    • current_segment_start_frames
    • current_segment_end_frames
    • current_remaining_frames_after
    • current_segment_start_s
    • current_segment_end_s
    • current_segment_report
    • fps_out
    • recommended_overlap_frames
    • recommended_audio_left_context_s
    • recommended_extension_preset
    • effective_planning_mode
    • planning_profile_report
    ◄song_duration_s180.00►
    ◄fps24.00►
    ◄segment_duration_s10.00►
    ◄planning_mode_inmanual_segment_seconds►
    ◄segment_preset_in10sec►
    ◄overlap_frames_in9►
    ◄ltx_round_modeup►
    ◄segment_index0►
    ◄ltx_round_mode_in►

    IAMCCS_SegmentPlannerLinked is the "don't repeat yourself" version of the IAMCCS_SegmentPlanner. In a long LTX-2 extension workflow you often end up with the planner duplicated all over the graph - one for the first segment, one per continuation, one for the last, maybe one inside each SuperNode. With the plain planner, that's a lot of widgets to keep in sync, and one stale overlap value three copies in means a seam you'll chase for an afternoon.

    This variant forces its planning settings through inputs instead of letting them be hand-edited widgets. Feed it from a single shared source - usually the pack's IAMCCS_SegmentPlannerSettings node - and every copy of the planner agrees on segment_duration_s, planning_mode, segment_preset, and overlap_frames because they all read the same wires. Change the setting once and the whole graph re-plans.

    How it works

    Under the hood it's the exact same plan() math as the base planner - song duration → total frames, 8n+1 LTX rounding via ltx_round_mode, first/continuation raw frame split, per-index current-segment numbers. The only real difference is plumbing: segment_duration_s, planning_mode_in, segment_preset_in, overlap_frames_in are all forceInput, so they're link-only. There's also an optional ltx_round_mode_in if you want to push the rounding mode too; leave it unconnected and the widget value wins.

    Inputs and outputs

    Set song_duration_s and fps like normal, then link the four settings inputs from your shared SegmentPlannerSettings node (or anywhere - they're plain FLOAT/STRING/INT wires). segment_index drives which segment's numbers you get this iteration.

    Outputs are identical to the base planner, and that's the point - drop it in place of a SegmentPlanner and nothing downstream changes:

    • total_frames, estimated_segments, continuation_loops, first_segment_raw_frames, continuation_raw_frames, last_segment_unique_frames
    • current-segment set: current_segment_raw_frames, current_segment_start_frames, current_segment_end_frames, current_segment_start_s, current_segment_end_s, current_remaining_frames_after, current_segment_report
    • recommendation outputs: recommended_overlap_frames, recommended_audio_left_context_s, recommended_extension_preset

    Wire current_segment_raw_frames into your sampler's length and the range nodes, and current_segment_start_s/_end_s into anything that needs to know where in the song you are.

    Installing

    Same pack as everything else: ComfyUI Manager → search "IAMCCS", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/IAMCCS/IAMCCS-nodes.git
    

    then restart. No extra models or pip installs for this node - it's pure arithmetic. The LTX-2 model and VAEs that actually generate the video are the heavy part, and they're on you.

    Gotchas

    The biggest one is a wiring trap rather than a math trap: if you link planning_mode_in and segment_preset_in from a settings node but leave segment_duration_s on its widget, you can accidentally get preset-driven durations that contradict the duration you think you set. When in doubt, link all four from the settings node and let it own the values - that's the workflow this node was built for. And remember segment_index still needs to advance each loop iteration, or every segment gets the same start frame.

    CategoryIAMCCS/LTX-2

    Inputs (9)

    NameTypeDefaultDescription
    song_duration_sFLOAT180.000.01–36000—
    fpsFLOAT24.000.001–240—
    segment_duration_sFLOAT10.000.01–3600—
    planning_mode_inSTRINGmanual_segment_seconds—
    segment_preset_inSTRING10sec—
    overlap_frames_inINT90–4096—
    ltx_round_modeCOMBOup3 options: up, nearest, down
    segment_indexINT00–100000—
    ltx_round_mode_inoptSTRING—

    Outputs (23)

    NameTypeDescription
    total_framesINT—
    unique_segment_framesINT—
    first_segment_raw_framesINT—
    continuation_raw_framesINT—
    estimated_segmentsINT—
    continuation_loopsINT—
    last_segment_unique_framesINT—
    reportSTRING—
    segment_index_outINT—
    current_segment_raw_framesINT—
    current_segment_unique_framesINT—
    current_segment_start_framesINT—
    current_segment_end_framesINT—
    current_remaining_frames_afterINT—
    current_segment_start_sFLOAT—
    current_segment_end_sFLOAT—
    current_segment_reportSTRING—
    fps_outFLOAT—
    recommended_overlap_framesINT—
    recommended_audio_left_context_sFLOAT—
    recommended_extension_presetSTRING—
    effective_planning_modeSTRING—
    planning_profile_reportSTRING—