Nodes/OmniNodes/Custom Folder Batch Saver πŸ“
ComfyUI Node

Custom Folder Batch Saver πŸ“

Saving straight to the client's folder, with numbering that never collides

By TensorVizionΒ·Created 3 months agoΒ·Updated about 8 hours agoΒ· 0
Custom Folder Batch Saver πŸ“
  • images
  • saved_paths
  • count
β—„output_diroutput/tensorvizion/batchesβ–Ί
β—„subfolderbatch_01β–Ί
β—„prefiximgβ–Ί
β—„pad_digits4β–Ί
β—„formatpngβ–Ί
β—„jpg_quality95β–Ί

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/batches and batch_01. Relative paths resolve from ComfyUI's working directory.
  • prefix - the filename stem (img by default). Name it something meaningful per project.
  • pad_digits - zero padding width, 4 by default β†’ img_0001.
  • format - png or jpg, with jpg_quality for 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.
CategoryTensorVizion/Image

Inputs (7)

NameTypeDefaultDescription
imagesIMAGEβ€”
output_dirSTRINGoutput/tensorvizion/batchesβ€”
subfolderSTRINGbatch_01β€”
prefixSTRINGimgβ€”
pad_digitsINT41–10β€”
formatCOMBOpng2 options: png, jpg
jpg_qualityINT951–100β€”

Outputs (2)

NameTypeDescription
saved_pathsSTRINGβ€”
countINTβ€”