🔥ImagesSave
Dump an IMAGE batch to disk as numbered PNGs
- images
- images_length
ImagesSave takes an IMAGE tensor (say, the frames you just processed through a KSampler) and writes every image in the batch to disk as a PNG - with the zero-padded, sequential filenames that make Frames2Video work perfectly. This is the output half of the pack's auxiliary chain. The whole arc: Video2Frames → LoadImageFromDir → ImagePath2Tensor → your image pipeline → ImagesSave → Frames2Video. This node is what turns "I processed 300 frames in ComfyUI" into "I have a folder Frames2Video can re-encode." It's effectively a better-behaved Save Image for batch work: it counts files for you and names them in order.
How it works
It iterates the batch, converts each tensor back to a PIL image (tensor2pil), and writes output_image_000000001.png, ..._000000002.png, and so on - with a global counter that continues across runs unless the output directory is empty, in which case it restarts at 1. The reset-on-empty behavior exists precisely so Frames2Video can pick up clean numbered sequences. Saves are multithreaded, and the node flushes model caches afterward.
The inputs that matter
- images - the
IMAGEtensor to save. Wire from your sampler/VAE output. - output_path - the directory. Pre-existing only - this node follows the pack convention and errors with
output_path is not a directoryif you didn't create it first.
Outputs
One output: images_length - an INT count of how many images were written this run. No path is returned (you already know where you told it to write), which is slightly unusual for this pack, but the count is the useful part.
Install
Standard pack install: ComfyUI Manager → search "ComfyUI-FFmpeg", or:
cd ComfyUI/custom_nodes
git clone https://github.com/MoonHugo/ComfyUI-FFmpeg
cd ComfyUI-FFmpeg
pip install -r requirements.txt
Restart ComfyUI.
Gotchas
- The numbering continues from the previous run's counter unless the folder is empty. Re-running into the same folder with leftovers gives you
..._000000301.png+ instead of overwriting - which is intentional (keeps sequences unique), but it can silently confuse Frames2Video if you expected a fresh sequence. Empty the folder first. - This is the pack node that pairs with Frames2Video most directly: names are zero-padded specifically so filename sort order = frame order. Keep using this pairing and you'll never hit the
frame_2afterframe_19sorting trap. - Writing 1000+ PNGs is I/O-bound and can look like a hang. It's not - the multithreaded pool is chewing through disk writes. Give it a moment before assuming it's stuck.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| output_path | STRING | C:/Users/Desktop/output | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images_length | INT | — |