Save With Original Names (TJ)
Save With Original Names (TJ)
- images
- IMAGE
The ComfyUI save problem, in one sentence: you load reference_photo_03.png, run it through something, and the result comes back as ComfyUI_00045_.png - all provenance gone. Save With Original Names (TJ) fixes exactly that: it saves each image in a batch under the filename it had when it came in. Load reference_photo_03.png, output reference_photo_03.png (or _upscaled variants). For dataset work and image-to-image loops, this is the node that keeps your folder sane.
How it works
The trick is that it doesn't try to guess names - it reads them. The input is filenames, a STRING, expected to be newline-separated original filenames, one per image in the batch. And where does that come from? Multi Image Loader (TJ) outputs exactly this on its FILENAMES socket. The intended pairing is direct:
Multi Image Loader (TJ) ──BATCH─────→ [your pipeline] ──→ images
└──FILENAMES────────────────────────────────────→ filenames
Load a stack with the loader, process the batch, and save with the loader's FILENAMES feed into this node. Every result keeps its source name.
The other inputs:
images- the processed batch.save_path- destination. Default blank, but the node isolates saves under anoutput/subfolder so you don't collide with your input files. Set it if you want a specific subfolder.extension_option-Original(keep each source's extension), or forcepng/jpg/webp.overwrite- default on: ifreference_photo_03.pngalready exists in the save folder, it replaces it. Turn it off to get auto-numbered variants instead.
Output: IMAGE - the batch passed through, so you can chain further nodes after saving.
Installing it
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/designloves2/ComfyUI-TJ_NODE
or ComfyUI Manager → ComfyUI-TJ_NODE → restart. No dependencies beyond the pack.
The honest take
This is a quiet workhorse and probably the pack's most underrated node. Its value scales with how much you do batch image processing - dataset preparation, batch upscaling, style-transfer passes - where matching output to source by name is the whole game. The pairing with Multi Image Loader is essentially mandatory; feed it filenames from anywhere else and you're on your own for format. Watch overwrite: on by default means a rerun silently replaces your previous results, which is usually what you want in a pipeline but a surprise if you expected history. One real gotcha: if the batch and the FILENAMES list get out of sync (you reordered images upstream but not the names), names will shift onto the wrong images - keep the loader's FILENAMES socket wired straight to this node's filenames and never reroute it.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| filenames | STRING | — | |
| save_path | STRING | — | |
| extension_option | COMBO | Original | 4 options: Original, png, jpg, webp |
| overwrite | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |