Save Image Enhanced (DN)
Your images, filed where you actually want them
- images
- last_filename_saved
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, sooutputis the familiar spot, or point it attraining_data/set1and 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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| filename_prefix | STRING | ComfyUI_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_folder | STRING | output | Subfolder within ComfyUI's output directory, or an absolute path. |
| add_counter_suffix | BOOLEAN | true | If 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_padding | INT | 51–9 | Controls 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_overwrite | BOOLEAN | false | If True, allows overwriting existing files with the same name. If False, automatically increments the filename prefix to find a unique name. |
| caption_file_extensionopt | STRING | .txt | The extension for the caption file. |
| captionopt | STRING | Optional: String to save as a caption file alongside the image. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| last_filename_saved | STRING | — |