Save Iterable Images To Paths
Saving Images to Exact Paths in ComfyUI
- images
- images
- saved_paths
ComfyUI's built-in SaveImage is great right up until it isn't. It dumps every image in your batch into output/ as ComfyUI_00001_.png, ComfyUI_00002_.png - auto-numbered, one folder, you don't get a vote. That's fine for quick saves and completely useless when image #3 of a batch needs to land at D:/training_data/real_photos/photo_017.jpg with a name you chose.
Save Iterable Images To Paths is the "I want the exact filename, thanks" node. Feed it a batch of images plus one path per image, and it writes each one to its own destination, creating any missing folders along the way. It's from the small mdl262/ComfyUI-Iterable-Nodes pack, which ships just this node and nothing else - no model downloads, no heavy dependencies, no API keys. A one-trick pony, but the trick is handy.
Why you'd reach for it
The classic use case is dataset building. If you're assembling LoRA training folders, class images, or per-image outputs that need names tied to prompts, seeds, or subject IDs, the default save node's counter gets you nowhere. This node maps image[i] to path[i] in order, so the structure of your output is decided by you, not by ComfyUI's auto-increment.
It also plays nicely in iterable workflows: because it passes the images through untouched and reports what it wrote, you can drop it mid-chain and have the saved_paths output feed a downstream node that logs or registers the files. It's an output node, so it always runs and the cache works backward from it - same behavior as SaveImage, just with way more control over where things land.
The inputs and outputs that matter
Two inputs, that's the whole node:
images- anyIMAGE, including a multi-image batch.save_paths- aSTRING, one path per line in the multiline box, or a JSON-style list like["C:/a.jpg", "C:/b.jpg"]. Relative paths, absolute paths, forward or back slashes, and~expansion all work.
The one rule: the number of paths must equal the number of images, or the node raises a ValueError that helpfully tells you how many of each you gave and shows a preview of the paths. That message is the author doing you a favor - read it before you go hunting.
Outputs: images (the original images, passed through) and saved_paths (the paths that were written, newline-separated, ready to hand to whatever needs to know what just got saved).
Where people get burned
Three things, all real:
- It always writes JPEG, whatever you name the file. The save call hardcodes
format="JPEG"withquality=100, subsampling=0. Give it a.pngpath and you'll get JPEG bytes wearing a PNG costume. The README says the same thing you'd hope: quality 100 is still lossy. If you need mathematically lossless output, this isn't your node - go back toSaveImagefor PNG. - You lose the workflow-in-the-image metadata. ComfyUI's default save embeds the whole node graph in the PNG, so you can drag an output back onto the canvas and rebuild. This node saves through Pillow, which doesn't write those chunks - a JPEG wouldn't carry them anyway. Keep your master PNGs from a normal save; treat these as pipeline/dataset exports.
- Alpha channels get flattened onto white. RGBA images are composited against a white background before saving. Usually that's fine; if you needed transparency preserved, it won't be.
Installing it
Through ComfyUI Manager, search for "Iterable Nodes" (the registry package id is iterable-nodes) and install. Or clone it by hand:
cd C:/path/to/ComfyUI/custom_nodes
git clone https://github.com/mdl262/ComfyUI-Iterable-Nodes.git
Then restart ComfyUI. The pack declares zero dependencies (dependencies = [] in its pyproject.toml) and only uses Pillow and NumPy, which ComfyUI already ships - so there's nothing extra to download, no missing-model panic.
The verdict
It's a tiny, opinionated utility for a specific annoyance: exact per-image file destinations in a batch. If you build datasets or pipeline outputs with names that matter, it earns its place in a couple of minutes. If you just save images to look at them, SaveImage already covers you - this one is only worth the install when the filenames are the point.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| save_paths | STRING | C:/path/to/image_001.jpg | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| saved_paths | STRING | — |