Spill Image Batch To Directory
Write every frame to disk — and keep the last twelve in memory
- images
- blended_images
- tail_images
- directory_path
- total_frame_count
- committed_frame_count
The name is more honest than most. This node "spills" an image batch out to a directory of numbered PNGs - every frame, one file - while keeping a configurable tail of frames in memory to hand back as a real IMAGE output. It lives under LTXDirector/memory next to FrameCountPassthrough, and it's exactly the plumbing a long multi-pass extension run needs: render a segment, dump it to disk where a loader can pick it back up for the next pass, but don't drop the last keep_tail frames, because those are the overlap context the continuation is going to lean on.
How it works. Feed it an images batch and it resolves directory against ComfyUI's output folder (the default is video/LTXDirector_v1_2_spill_frames), creates it if needed, and writes image_count - keep_tail frames as PNGs named <filename_prefix>_000000.png and up. keep_tail (default 12) is the number of most-recent frames that stay in the returned batch rather than being committed to disk. Existing frames in the directory are counted, so numbering continues across runs instead of clobbering - unless you tick reset_directory, which wipes the folder first. use_blended_images (with the optional blended_images input) swaps in a blended batch for saving, which matters if you want the transition-smoothed frames on disk rather than the raw ones.
Outputs. tail_images is the last keep_tail frames - wire that into your next pass's overlap handling. directory_path is the resolved absolute path, handy for external loaders. total_frame_count is how many frames exist now (existing + new), and committed_frame_count is how many were actually written. That pair is useful when you're keeping a long run's accounting straight.
Install is the pack standard:
cd ComfyUI/custom_nodes
git clone https://github.com/Yogurt1192/LTXDirector-Extender.git
Restart ComfyUI. Pure PyTorch/PIL work - no models, no new pip packages.
Where people get burned. Two things trip people up. First, the default directory is relative to ComfyUI's output folder, so don't go hunting for it in the project root - and if you pass an absolute path it's honored as-is. Second, the "spill" is additive by design: if you forget reset_directory and run again, your old frames stay and numbering continues, which is great for accumulation and confusing when you're testing. keep_tail is clamped to the batch size, so you can't request more frames back than went in. And if you ever see ValueError: images input is required, that's a genuine upstream disconnection - this node refuses to silently write an empty batch.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| directory | STRING | video/LTXDirector_v1_2_spill_frames | — |
| filename_prefix | STRING | frame | — |
| keep_tail | INT | 120–4096 | — |
| reset_directory | BOOLEAN | false | — |
| use_blended_images | BOOLEAN | false | — |
| blended_imagesopt | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| tail_images | IMAGE | — |
| directory_path | STRING | — |
| total_frame_count | INT | — |
| committed_frame_count | INT | — |