Save To Folder (create/specify path)
The unglamorous node that makes batch-candidate pipelines work
- images
- folder
Save To Folder does one boring thing and does it well: it writes images to a folder, creating the folder if it doesn't exist, and it continues numbering from whatever's already there. Boring, until you realize that second behavior is what makes the whole "generate a thousand candidates, rank them later" workflow possible.
It's the first half of the QualityGate pack's two-stage design. The idea: instead of hammering the sampler with a giant batch (which holds every latent in memory and OOMs), you run small batches, write each one's output to a folder with this node, and queue as many times as you want. Because it picks up the filename counter where the last run left off, every run adds to the folder instead of overwriting. Later, the pack's CompositeRankFolder streams that same folder and ranks it - you never had to hold all the candidates in RAM at once.
The one behavior that matters
A plain SaveImage is fine for saving; the differentiator here is the numbering. The node scans the target folder for existing files matching prefix_NNN.png, finds the highest number, and continues from there. Queue the workflow five times and you get cand_001.png through cand_0NN.png accumulating on disk. That's the accumulation trick that the whole "generate in waves, rank at the end" pattern leans on - no manual file management, no overwrites, no collisions.
Inputs and outputs
images- what you're saving.folder- where. A relative name likeqg_candidatesresolves under ComfyUI'soutput/directory; an absolute path is used as-is. Relative is the default and the right choice for this pack, because the ranking node picks folders via a dropdown ofoutput/subfolders.filename_prefix- the stem for saved files, defaultcand.
It's marked as an output node, and it returns folder - the resolved path as a STRING. That's mostly for logging or passing to a text node; the actual ranking-node connection happens by picking the folder in the dropdown, not by wiring.
Gotchas
Two small things. First, it saves PNGs, so don't expect control over format or metadata - this node is a staging area, not a deliverable saver. Second, the author's own detail: it uses unicode-safe file I/O, which in practice means paths with Japanese or other non-ASCII characters work - a genuine courtesy if your project folders live outside ASCII.
Is it the most exciting node in the pack? No. But every other node in this pack is downstream of it: the ranking nodes are only as good as the candidate folders they read, and without the continue-numbering behavior, the two-stage pipeline would quietly start overwriting itself on the second queue run. If you're using the pack at all, this is the quiet scaffolding that makes the rest of it make sense.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| folder | STRING | qg_candidates | — |
| filename_prefix | STRING | cand | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| folder | STRING | — |