LTX-2 Long Video Wrapper Prep (Disk) ????
Chop a whole song into LTX-2-ready segments without the frame math
- images
- current_segment
- total_segments
- segment_report
- plan_report
- trim_head_frames
- render_id
- continuation_trim_head_frames
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:
- Plan - an internal segment planner turns
song_duration_s,fps, andsegment_duration_sinto a full segment table: total segments, per-segment frame counts, overlap, and trim amounts. It rounds frame counts to LTX-2's8n+1rule usingltx_round_mode(updefault,nearest,down). - Slice -
IAMCCS_LoadImagesFromDirLiteloads just the current segment's frame range fromframes_dir, driven bysegment_index. - Anchor & pad - the segment's first frame is re-applied to the head (
head_k_frames, default 1) usinghead_mode(hard_lockdefault,linear_blend,ramp) so every segment starts from a stable anchor.min_frames(default 25) guarantees a minimum length - padding byrepeat_lastor raising iferror- with an LTX frame fix on top. Optionallyuse_bridge_anchorswaps 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.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| frames_dir | STRING | iamccs_source_frames/source_video | — |
| song_duration_s | FLOAT | 180.000.01–36000 | — |
| fps | FLOAT | 24.000.001–240 | — |
| segment_duration_s | FLOAT | 10.000.01–3600 | — |
| segment_index | INT | 00–1000000 | — |
| render_idopt | STRING | — | |
| bridge_nameopt | STRING | ltx2_detailer_bridge | — |
| use_bridge_anchoropt | BOOLEAN | false | — |
| planning_modeopt | COMBO | manual_segment_seconds | 2 options: manual_segment_seconds, auto_profile |
| content_profileopt | COMBO | videoclip | 2 options: videoclip, monologue |
| overlap_framesopt | INT | 90–4096 | — |
| ltx_round_modeopt | COMBO | up | 3 options: up, nearest, down |
| head_k_framesopt | INT | 11–64 | — |
| head_modeopt | COMBO | hard_lock | 3 options: hard_lock, linear_blend, ramp |
| head_blend_strengthopt | FLOAT | 1.000–1 | — |
| min_framesopt | INT | 251–1000000 | — |
| min_frames_modeopt | COMBO | repeat_last | 2 options: repeat_last, error |
| min_frames_ltx_fixopt | COMBO | up | 4 options: none, up, down, nearest |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| current_segment | INT | — |
| total_segments | INT | — |
| segment_report | STRING | — |
| plan_report | STRING | — |
| trim_head_frames | INT | — |
| render_id | STRING | — |
| continuation_trim_head_frames | INT | — |