Source Frames To Disk ????
Cache your source video frames once so long LTX runs stop re-reading the file
- images
- frames_dir
- frame_count
- report
Long LTX-2 extension runs have a boring but real problem: every segment generation wants the same source frames, and if your workflow loads a video file (or a big IMAGE batch) fresh each iteration, you're wasting RAM and re-decoding constantly. IAMCCS_SourceFramesToDisk is the "do it once" node - you feed it the source frames a single time and it writes them out as individual image files to disk, giving the rest of your extension loop a stable, cheap-to-read cache.
It's the setup half of the pack's disk-based extension workflow. Once the frames are cached, the loop reads the slices it needs via the range nodes and the disk start-frame injector (StartDirToVideoLatent) instead of holding the whole source in memory. That's the same low-RAM philosophy as the pack's VAE Decode → Disk node: keep big tensors off system RAM, let disk be the buffer.
How it works
Simple and predictable: take the images batch, clamp to 0–1, and write each frame as {prefix}_{number:05d}.{format} into a directory that resolves under ComfyUI's output folder. jpg is the default (with jpg_quality, default 95); png and webp are options when you need lossless or smaller files. clear_existing (default on) wipes previously cached frames matching your prefix before writing, so stale frames from an earlier source video can't linger and corrupt the cache. start_number lets you offset the numbering (default 0).
Because the node is marked IS_CHANGED → nan, ComfyUI always re-runs it - you don't have to fight the cache when the source changes.
Inputs and outputs
- images - the source frames (load your video into an IMAGE batch once upstream).
- output_dir - relative paths land in the output folder; the default is
iamccs_source_frames/source_video. - prefix, image_format, jpg_quality, clear_existing, start_number - filename and format control.
Outputs: frames_dir (the absolute path, wire it into the disk-based nodes), frame_count, and report.
Installing
ComfyUI Manager → search "IAMCCS", or
cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git
Restart. It needs Pillow, which ships with ComfyUI, so no extra installs. No model files involved.
Gotchas
Watch where output_dir actually lands - it's resolved relative to ComfyUI's output directory, not your current working directory, and an absolute path is honored as-is. If a later segment reads an empty folder, nine times out of ten it's because clear_existing wiped the cache while a stale plan still pointed at the old path, or because the prefix/start_number conventions don't match what the reader expects. And if you're low on disk, remember jpg at 95 on a long video is still a lot of files - that's the price of the low-RAM tradeoff.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Source video frames loaded once from a single video input. | |
| output_dir | STRING | iamccs_source_frames/source_video | Directory where the source frame cache will be written. |
| prefix | STRING | source | Frame filename prefix. |
| image_format | COMBO | jpg | 3 options: jpg, png, webp |
| jpg_quality | INT | 951–100 | — |
| clear_existing | BOOLEAN | true | — |
| start_number | INT | 00–100000000 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| frames_dir | STRING | — |
| frame_count | INT | — |
| report | STRING | — |