Nodes/IAMCCS-nodes/Source Frames To Disk ????
ComfyUI Node

Source Frames To Disk ????

Cache your source video frames once so long LTX runs stop re-reading the file

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
Source Frames To Disk ????
  • images
  • frames_dir
  • frame_count
  • report
output_diriamccs_source_frames/source_video
prefixsource
image_formatjpg
jpg_quality95
clear_existingtrue
start_number0

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.

CategoryIAMCCS/LTX-2

Inputs (7)

NameTypeDefaultDescription
imagesIMAGESource video frames loaded once from a single video input.
output_dirSTRINGiamccs_source_frames/source_videoDirectory where the source frame cache will be written.
prefixSTRINGsourceFrame filename prefix.
image_formatCOMBOjpg3 options: jpg, png, webp
jpg_qualityINT951–100
clear_existingBOOLEANtrue
start_numberINT00–100000000

Outputs (3)

NameTypeDescription
frames_dirSTRING
frame_countINT
reportSTRING