Save Image (Dataset) MXD
Save images under their real names — for datasets, not galleries
- images
- filename
Every normal ComfyUI save node renames your output: a timestamp or a counter gets appended so nothing is ever overwritten. That's the right behavior for a gallery and the wrong behavior for dataset prep, where you're round-tripping cat.png back out as cat.png so its sidecar cat.txt caption still lines up. Save Image (Dataset) MXD does the thing the core node refuses to: it writes your image under the exact filename you give it, no prefix, no counter, and it tells you what it wrote.
How it works
You pass in images, a filename (any extension is stripped and .png is forced), and where to put it: source (inputs or outputs) plus an optional subfolder. A single image saves as exactly that name; a batch of N saves as name.png, name_1.png, name_2.png and so on. The filename output returns what was actually written - one per line for batches - so a downstream node can log or chain the result. There's an optional embed_workflow toggle if you want the workflow baked into the PNG metadata, but it defaults off because you usually don't want that in training data.
The pairing that makes it shine
The intended loop is: Load Image (From Folder) MXD on one side, this node on the other. The loader's filename output feeds this node's filename input, the image flows through your preprocessing (resize, crop, color fix, whatever), and every image saves back under its own name. Captions stay paired, nothing collides, and you can run the whole folder with run_folder on the loader. The author's own tooltip hammers one point: put the output in a different subfolder than your source - flux_processed, say - so you're not overwriting the originals while you experiment.
Inputs
- images - what to save.
- filename - exact base name. Connect the loader's filename output here.
- source -
inputsoroutputs, defaultinputs. - subfolder - optional subfolder under the source root.
- embed_workflow - optional, defaults off.
Installing
ComfyUI Manager → search "Maxed Out" → install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Maxed-Out-99/ComfyUI-MaxedOut.git
No pip dependencies.
Common issues
An empty filename raises a clear error rather than guessing - wire the loader's filename output or type one. The big footgun is the subfolder discipline: defaulting to inputs with no subfolder writes back over your originals, which is exactly the collision this node exists to let you have if you're not careful. And remember it's a training-prep tool, not a general saver - if you want numbered, never-overwrite outputs for a portfolio, the core Save Image is still the right node.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Images to save. | |
| filename | STRING | Exact base filename to save as. Any extension is stripped and replaced with .png. Connect the 'filename' output of Load Image (From Folder) MXD to keep dataset pairing with a sidecar .txt. | |
| source | COMBO | inputs | Folder root to save into. |
| subfolder | STRING | Optional subfolder under the source root, e.g. 'flux_processed'. Use a different subfolder than your source images so you don't overwrite the originals. | |
| embed_workflowopt | BOOLEAN | false | Embed workflow metadata in the saved PNG. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| filename | STRING | The filename(s) written, one per line if the batch had more than one image. |