Custom Folder Batch Saver π
Saving straight to the client's folder, with numbering that never collides
- images
- saved_paths
- count
Core SaveImage writes into ComfyUI's managed output/ tree with its own prefix_00001_ naming and embeds workflow metadata. That's fine for personal use and sharing, but it's the wrong shape when you're exporting a batch into a client deliverable folder, a dataset directory, or anywhere else that isn't ComfyUI's output root. Custom Folder Batch Saver is the node for that job: it writes a whole IMAGE batch to an arbitrary directory with clean, zero-padded, persistent numbering.
The persistence is the part worth caring about. Before writing, it scans the target folder for existing files matching your prefix and starts the counter past the highest one. Run the same batch twice and you get img_0005, img_0006... instead of clobbering what's already there. For batch jobs you re-run, that's the difference between a dataset you can trust and one that silently overwrites frames.
Inputs that matter:
output_dir+subfolder- where files go, e.g.output/tensorvizion/batchesandbatch_01. Relative paths resolve from ComfyUI's working directory.prefix- the filename stem (imgby default). Name it something meaningful per project.pad_digits- zero padding width, 4 by default βimg_0001.format-pngorjpg, withjpg_qualityfor the lossy path. PNG for datasets, JPG when disk or deliverable size matters.
Outputs are saved_paths (a newline-joined string of every file written - feed it to a text display, or another node that wants the paths) and count (how many files this run wrote). It's an output node, so it terminates a branch like any saver.
It's deliberately plain. No metadata embedding, no PNG workflow round-trip - it writes pixels and a predictable name and gets out of the way. If you need generation-parameter records alongside the files, the pack's Workflow Manifest Writer or a metadata reader/writer pair is the companion; if you want the full embedded-workflow behavior, core SaveImage is still your friend. Pick based on where the files are going, not which is "better."
The honest gotcha is the relative-path one. If you type a bare path like output/tensorvizion/batches, it's interpreted relative to wherever ComfyUI was launched - which is usually the ComfyUI install root, but not always (launch scripts and one-click packages can change the working directory). For anything you care about, give it an absolute path and save yourself the archaeology.
Install
Part of OmniNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes
Restart ComfyUI, or use ComfyUI Manager ("OmniNodes"). No extra pip packages - Pillow, which ComfyUI already ships.
Troubleshooting
- Files went somewhere unexpected - you used a relative
output_dir. Switch to an absolute path. - Numbering reset or jumped - the node only counts files that match
prefix_exactly. A different prefix in the same folder is invisible to it, which is by design but easy to misread as a bug. - No files written - it's an output node; make sure something downstream isn't bypassing it, and check the terminal for
[OmniNodes]errors.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| output_dir | STRING | output/tensorvizion/batches | β |
| subfolder | STRING | batch_01 | β |
| prefix | STRING | img | β |
| pad_digits | INT | 41β10 | β |
| format | COMBO | png | 2 options: png, jpg |
| jpg_quality | INT | 951β100 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| saved_paths | STRING | β |
| count | INT | β |