Image Batch Saver
Save images with matching .txt captions, or stack frames into a GIF
- images
Image Batch Saver is the write-half of the batch pipeline: it takes images, writes them to disk with a counter-safe filename, and drops a matching .txt file beside each one. If you're assembling a training dataset or just want every generated image to carry its caption as a sidecar file, this is the node that makes it painless. It's an output node with no outputs, and every input is optional.
Its two best tricks are the companion text files and the append_frames mode, so let's talk about those.
The companion .txt files
The contents input is a forceInput string - it wants a wire, typically from this pack's TXT Batch Loader or Text Modify Tool. For every image saved, the node writes <name>.txt next to it containing that text. That's the classic image-text pair layout that LoRA trainers and dataset prep scripts expect: one image, one caption, same basename. The lora-training crowd will recognize why that matters - dataset organization is half the battle when you're captioning by hand or running a tagger.
append_frames: the memory trick
append_frames (off by default) appends new frames to an existing file with the same base name instead of creating a new one. The point is memory: rather than hold an entire animation in VRAM and write it in one shot, you can loop, generate a few frames, append them, repeat. The tooltip says it plainly: "Useful for accumulating frames across loop iterations to reduce memory usage." One catch worth knowing: PNG can't hold multiple frames, so if you enable append_frames with a non-animated format, the node auto-converts the output to GIF. If you were expecting a PNG sequence, that's the moment you learn why you got a GIF.
The inputs that matter
images- a batch tensor. Multi-frame tensors get sliced bystart_index/end_index(1-based, 0 = all frames) before saving.output_path- empty goes to ComfyUI's default output dir; relative paths land under it.extension- png, jpg, jpeg, webp, bmp, tiff, or gif. Default png.filename_prefix(defaultIMG),filename_number(off/start/end, defaultend),filename_number_padding(default 4) - together these build names likeIMG_0001.png, with the counter where you want it.embeded_workflow(default on) - embeds the workflow into the PNG metadata, matching the built-in Save Image behavior. PNG is where the metadata goes; don't count on it surviving a JPEG.
Installing it
Part of Zar4X/ComfyUI-Batch-Process - Manager search ComfyUI-Batch-Process, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Zar4X/ComfyUI-Batch-Process
Restart. Dependencies are Pillow and torch, both already present.
Troubleshooting
The node always re-executes on queue runs, so repeated runs write fresh counter numbers rather than overwriting - if files keep appearing with new numbers, that's the counter doing its job, not a leak. If append_frames isn't producing the animation you expect, double-check the extension: you either need to select GIF yourself or accept the auto-conversion. And remember the node is fine running with no images at all - it'll just generate filenames. If you wired it up and see paths but no pictures, check whether images is actually connected.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| imagesopt | IMAGE | — | |
| contentsopt | STRING | — | |
| output_pathopt | STRING | — | |
| filename_prefixopt | STRING | IMG | — |
| filename_delimiteropt | STRING | _ | — |
| filename_suffixopt | STRING | — | |
| extensionopt | COMBO | png | 7 options: png, jpg, jpeg, webp, bmp, tiff, +1 |
| filename_number_paddingopt | INT | 41–9 | — |
| filename_numberopt | COMBO | end | 3 options: off, start, end |
| embeded_workflowopt | BOOLEAN | true | — |
| append_framesopt | BOOLEAN | false | Append new frames to existing file with same base name. Useful for accumulating frames across loop iterations to reduce memory usage. |
| start_indexopt | INT | 00–999999 | Start index (1-based) for frames to save. Use 0 to save all frames, or set 1 for first frame, 2 for second frame, etc. |
| end_indexopt | INT | 00–999999 | End index (inclusive, 1-based) for frames to save. Use 0 to save all remaining frames, or set >0 to limit range. |
Outputs (0)
No outputs