Nodes/comfyui-save-image-enhanced/Save Image Enhanced (DN)
ComfyUI Node

Save Image Enhanced (DN)

Your images, filed where you actually want them

By KY-2000·Created about a year ago·Updated about a year ago· 1
Save Image Enhanced (DN)
  • images
  • last_filename_saved
filename_prefixComfyUI_DN_%date:yyyy-MM-dd%
output_folderoutput
add_counter_suffixtrue
counter_padding5
allow_overwritefalse
caption_file_extension.txt
caption

Everyone ends up with an output/ folder that's a thousand images deep and no way to tell which run was which. The stock Save Image node works, but its naming is a shrug. SaveImageEnhancedNode is the version that files things where you want them, names them with a prefix you control, and - the useful trick - writes a caption file next to each image.

It's an output node (the readme calls it "a better save node"), and if you've ever built a training dataset or just wanted per-run folders, you'll get it immediately. The caption sidecar is the sleeper feature: drag your caption in, and every saved PNG gets a matching .txt written alongside it. That's the exact layout most LoRA training scripts expect to chew through.

How it works

The node takes an IMAGE tensor, converts each frame to a PIL image, and writes PNGs into whatever folder you set. It builds each filename from your prefix, appends a zero-padded counter so nothing overwrites, and - if a caption is present - writes a UTF-8 sidecar file. It's about as deep as file I/O gets, which is to say not very, but the details are where save nodes live or die.

The inputs that matter

  • output_folder - default output. Relative to your ComfyUI working directory, so output is the familiar spot, or point it at training_data/set1 and watch the files land.
  • filename_prefix - the interesting one. The default is ComfyUI_DN_%date:yyyy-MM-dd%, and the tooltip bills that date token as a placeholder.
  • add_counter_suffix - default on, _00000-style, so a batch doesn't clobber itself.
  • caption (optional, multiline) and caption_file_extension (default .txt) - the pair that writes the sidecar.

The gotcha you'd hit on run one

The default prefix contains %date:yyyy-MM-dd%, but the shipped code never actually expands that token - I checked the source, the string goes straight into the filename. Run with defaults and your files come out literally named ComfyUI_DN_%date:yyyy-MM-dd%_00000.png. It's cosmetic, not fatal: just type a plain prefix like ComfyUI_DN_ or set1_v2_ and move on. Also worth knowing: the counter suffix is the batch index, so it restarts at 00000 every run - it prevents overwriting within a batch, not across runs.

Output

  • saved_paths (STRING) - a summary line like "Saved N images to <folder>", not a list of paths, despite the name. Read it in a text preview if you want proof of what happened.

Installing it

Same shared pack install as everything else in Divergent Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/thedivergentai/divergent_nodes.git divergent_nodes
cd divergent_nodes
pip install -r requirements.txt

Or via ComfyUI Manager, searching "Divergent Nodes". The pack targets the newer v3 node API, so a current ComfyUI matters - on an old build the whole suite may not register.

Where you'd actually use it

This is the node to reach for when the stock saver isn't enough: dataset runs where you need captions beside images, per-iteration folders you can sort, or just wanting your good outputs in a folder named after the project instead of buried in the global dump. For plain "save and preview" work, the built-in Save Image does the job with fewer moving parts - this one earns its keep when file management is the point.

CategoryDivergent Nodes 👽/Image

Inputs (8)

NameTypeDefaultDescription
imagesIMAGE
filename_prefixSTRINGComfyUI_DN_%date:yyyy-MM-dd%The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes. Supports %batch_num%.
output_folderSTRINGoutputSubfolder within ComfyUI's output directory, or an absolute path.
add_counter_suffixBOOLEANtrueIf True, adds an incrementing numerical suffix (_00001_) to the filename to prevent overwriting. If the filename_prefix ends with a number, that number is treated as the initial counter value.
counter_paddingINT51–9Controls the minimum number of digits (with leading zeros) for the counter suffix added by 'add_counter_suffix'. For example, padding of 3 will produce _001_, _002_, etc.
allow_overwriteBOOLEANfalseIf True, allows overwriting existing files with the same name. If False, automatically increments the filename prefix to find a unique name.
caption_file_extensionoptSTRING.txtThe extension for the caption file.
captionoptSTRINGOptional: String to save as a caption file alongside the image.

Outputs (1)

NameTypeDescription
last_filename_savedSTRING