Nodes/IAMCCS-nodes/LTX-2 Long Video Wrapper Prep (Disk) ????
ComfyUI Node

LTX-2 Long Video Wrapper Prep (Disk) ????

Chop a whole song into LTX-2-ready segments without the frame math

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
LTX-2 Long Video Wrapper Prep (Disk) ????
    • images
    • current_segment
    • total_segments
    • segment_report
    • plan_report
    • trim_head_frames
    • render_id
    • continuation_trim_head_frames
    frames_diriamccs_source_frames/source_video
    song_duration_s180.00
    fps24.00
    segment_duration_s10.00
    segment_index0
    render_id
    bridge_nameltx2_detailer_bridge
    use_bridge_anchorfalse
    planning_modemanual_segment_seconds
    content_profilevideoclip
    overlap_frames9
    ltx_round_modeup
    head_k_frames1
    head_modehard_lock
    head_blend_strength1.00
    min_frames25
    min_frames_moderepeat_last
    min_frames_ltx_fixup

    Planning a 3-minute music video in LTX-2 by hand is a gauntlet of arithmetic: the source is N frames, the segment should be 10 seconds at 24fps, LTX wants 8n+1 frame counts, you need overlap for continuity, and every number has to round consistently or the timeline drifts by the third segment. This node does all of that planning for you. Give it the song duration, the fps, and a target segment length, and it slices the source footage into per-segment image batches with the LTX-2 constraints already applied.

    The "Disk" in the name is the memory story: the source frames live in a directory (iamccs_source_frames/source_video by default) and are loaded range-by-range, one segment at a time, so a 180-second video never has to sit in RAM as one giant IMAGE batch. This is the prep node for the pack's low-RAM long-video pipeline - pair it with the samplers and bridges and you get continuous generation that doesn't OOM your system RAM.

    How it works

    It's a three-stage pipeline inside one node:

    1. Plan - an internal segment planner turns song_duration_s, fps, and segment_duration_s into a full segment table: total segments, per-segment frame counts, overlap, and trim amounts. It rounds frame counts to LTX-2's 8n+1 rule using ltx_round_mode (up default, nearest, down).
    2. Slice - IAMCCS_LoadImagesFromDirLite loads just the current segment's frame range from frames_dir, driven by segment_index.
    3. Anchor & pad - the segment's first frame is re-applied to the head (head_k_frames, default 1) using head_mode (hard_lock default, linear_blend, ramp) so every segment starts from a stable anchor. min_frames (default 25) guarantees a minimum length - padding by repeat_last or raising if error - with an LTX frame fix on top. Optionally use_bridge_anchor swaps in the last-frame bridge PNG as the head for genuine cross-segment continuity.

    Everything important is surfaced as outputs, not buried: current_segment, total_segments, trim_head_frames, continuation_trim_head_frames, segment_report, and plan_report - plus a fresh render_id when you didn't supply one, which is what keeps the whole chain keyed together.

    Inputs and outputs

    • frames_dir - source frames directory.
    • song_duration_s, fps, segment_duration_s, segment_index - the planning inputs.
    • Optional: render_id, bridge_name, use_bridge_anchor, planning_mode (manual_segment_seconds / auto_profile), content_profile (videoclip / monologue), overlap_frames, ltx_round_mode, head_k_frames, head_mode, head_blend_strength, min_frames, min_frames_mode, min_frames_ltx_fix.

    Outputs: images (the current segment), current_segment, total_segments, segment_report, plan_report, trim_head_frames, render_id, continuation_trim_head_frames.

    Install

    ComfyUI Manager → "IAMCCS", or:

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

    Restart. No extra deps - the frame loading and planning are all in-pack.

    Gotchas

    The whole node is a contract with its inputs: frames_dir must contain the frames in order (zero-padded names help), fps must match how those frames were extracted, and segment_duration_s times fps should be within your VRAM's comfort zone. When the timeline drifts, check plan_report first - it narrates every rounding decision, so a wrong ltx_round_mode or an overlap_frames that isn't 8n+1-friendly shows up there long before the video does. And if a segment comes back too short, min_frames_mode: error is your debugging friend: it turns silent padding into a loud failure.

    CategoryIAMCCS/LTX-2

    Inputs (18)

    NameTypeDefaultDescription
    frames_dirSTRINGiamccs_source_frames/source_video
    song_duration_sFLOAT180.000.01–36000
    fpsFLOAT24.000.001–240
    segment_duration_sFLOAT10.000.01–3600
    segment_indexINT00–1000000
    render_idoptSTRING
    bridge_nameoptSTRINGltx2_detailer_bridge
    use_bridge_anchoroptBOOLEANfalse
    planning_modeoptCOMBOmanual_segment_seconds2 options: manual_segment_seconds, auto_profile
    content_profileoptCOMBOvideoclip2 options: videoclip, monologue
    overlap_framesoptINT90–4096
    ltx_round_modeoptCOMBOup3 options: up, nearest, down
    head_k_framesoptINT11–64
    head_modeoptCOMBOhard_lock3 options: hard_lock, linear_blend, ramp
    head_blend_strengthoptFLOAT1.000–1
    min_framesoptINT251–1000000
    min_frames_modeoptCOMBOrepeat_last2 options: repeat_last, error
    min_frames_ltx_fixoptCOMBOup4 options: none, up, down, nearest

    Outputs (8)

    NameTypeDescription
    imagesIMAGE
    current_segmentINT
    total_segmentsINT
    segment_reportSTRING
    plan_reportSTRING
    trim_head_framesINT
    render_idSTRING
    continuation_trim_head_framesINT