Nodes/ComfyUI_Fill-Nodes/FL Save Images
ComfyUI Node

FL Save Images

Custom folders, templated filenames, no overwrites

By filliptm·Created 3 years ago·Updated about 17 hours ago· 628
FL Save Images
  • images
  • STRING
base_directory./output
folder_structure[]
file_name_templateimage_{index}.png
start_index1
auto_incrementtrue
metadata

ComfyUI's built-in Save Image node is fine right up until you want any control over where and how things land on disk. Then it's a straitjacket - everything goes to the output folder with a prefix and a number, take it or leave it. FL_SaveImages is the "leave it" option: custom base directory, a templated filename, an auto-incrementing index so you never clobber a previous run, and optional metadata written alongside. If you're organizing a lot of output - a dataset, a client's batches, frames by scene - this is the node that keeps it tidy.

How it works

You point it at a base_directory, optionally describe a folder_structure, give it a file_name_template with an {index} placeholder, and it writes each incoming image out, bumping the index each time so filenames stay unique. Turn auto_increment on (it's the default) and it hunts for the next free number instead of overwriting - so re-running a workflow appends rather than destroys. You can also pass a metadata string to save as a sidecar text file next to each image, which is handy when you want the prompt or settings travelling with the picture.

It's an output node, so it terminates a branch, but it also returns the path it wrote to as a STRING if you want to chain further logic off "where did that go."

The inputs that matter

  • images - the batch to save.
  • base_directory - the root folder. Default is ./output.
  • file_name_template - the filename pattern, e.g. image_{index}.png. The {index} token is what gets incremented.
  • start_index - where the numbering begins.
  • auto_increment - keep this on to avoid overwriting existing files; it finds the next open index.
  • folder_structure - a JSON list describing subfolders, if you want output organized into a directory tree rather than a flat folder.
  • metadata (optional) - text saved as a sidecar file per image.

Output is a STRING with the save path.

Installing it

Part of the Fill-Nodes pack. ComfyUI Manager: search ComfyUI_Fill-Nodes, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes

then restart. The pack drops a "Machine Delusions" banner in the console at startup - cosmetic.

Where people get tripped up

  • On cloud or serverless ComfyUI, arbitrary local paths don't persist. This is the one to watch. A hosted/serverless runner (like running on comfy.icu) collects your outputs from the platform's own output location and stores them - it isn't handing you the container's filesystem. Writing to some custom base_directory may vanish when the worker spins down. If you're on a managed runner, save to the expected output path and let the platform capture it; the fancy folder trees are a local-machine luxury.
  • {index} is the token that matters. Forget it in your template and every image tries to write to the same name - auto_increment will still bump, but your filenames won't reflect it the way you expect. Keep {index} in the pattern.
  • folder_structure is JSON, not a path string. It expects a list format; a raw foo/bar string won't do what you think. If the subfolders aren't appearing, check that.
  • It's a terminal node. It ends its branch. If you need the images and to keep processing them, tee the batch before this node rather than expecting an image output - this one only returns the path.
Category🏵️Fill Nodes/Image

Inputs (7)

NameTypeDefaultDescription
imagesIMAGE
base_directorySTRING./output
folder_structureSTRING[]
file_name_templateSTRINGimage_{index}.png
start_indexINT10–1000000
auto_incrementBOOLEANtrue
metadataoptSTRING

Outputs (1)

NameTypeDescription
STRINGSTRING