YG Download Images By Category
Save a batch's images grouped by category, then grab one ZIP
- images
If you're generating a few hundred images in a batch, the last thing you want is to dig through output/ afterwards. YG Download Images By Category (class YGSaveAllImages) collects every image from a run into one folder of your choosing, lets a subfolder input act as a category so related groups stay separated, and keeps a single ZIP file updated as images arrive - with one download button for the whole thing. It's the save-node companion to YG Prompt List By Category, and it was built for exactly that pairing.
How it works
Each run it takes the incoming images tensor and writes every frame as PNG, JPG, or WebP (your call) into output_folder. If the subfolder input is non-empty, files go into output_folder/<subfolder>/ - so when you wire the category output of the prompt-list node in, "animals" images end up in an animals/ folder. That's where the "By Category" in the display name comes from.
The clever part is the ZIP handling. Most naive implementations rebuild the archive from scratch every run, which is O(n²) and turns into hours for a big batch. This one appends only the newly saved files to the existing ZIP, so it stays fast no matter how many images pile up. PNG saves also embed the workflow prompt and any extra PNG info as metadata (a nice touch most batch savers skip). When it's wired to the prompt-list node's total output, it can detect when the batch is actually done and fire a "ready" event that makes the download button appear at the right moment.
The inputs that matter
output_folder- where everything lands. Defaults toComfyUI/output/z_save_all.filename_prefix- base name (image_00001.png, ...).format/quality- png/jpg/webp and quality (jpg/webp only).zip_filename- the archive name insideoutput_folder.subfolder- the category. Leave blank to save flat; wire the prompt-list'scategoryoutput here for grouped folders. This is the input that makes the node "by category."filename/total- optional;filenameoverrides auto-numbering,totalenables the done-detection described above.
There are no outputs - it's an output node that just writes files. There's also a reset endpoint in the web UI: "Run All" on the paired prompt-list node clears the folder first so only the current batch ends up in the ZIP.
Installing it
Part of comfyui_yg_nodes (MIT, "YG Custom Nodes" v1.0.4 by Mallikarjuna Rao Koliparthi), no extra Python dependencies. Install via ComfyUI Manager (search comfyui_yg_nodes) or:
cd ComfyUI/custom_nodes
git clone https://github.com/mallikarjunaraokoliparthi/comfyui_yg_nodes.git
Restart ComfyUI; it's in YG/IO.
Common issues
Because the ZIP is append-only, an interrupted run leaves a partially built archive - the download button only appears once the batch's total is reached, so a crashed run just won't show it (you can still grab the files from the folder directly). The reset that clears the folder only happens through the UI's Run All flow, not automatically, so re-runs of the same batch can double up files unless you reset. And like every save node, these are freshly re-encoded images - metadata survives for PNG (it's written on save), but convert to JPG and the embedded workflow is gone. For "generate a categorized batch, review as one ZIP," it's a tidy fit.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| output_folder | STRING | /tmp/ComfyUI/output/z_save_all | — |
| filename_prefix | STRING | image | — |
| format | COMBO | png | 3 options: png, jpg, webp |
| quality | INT | 951–100 | — |
| zip_filename | STRING | all_images.zip | — |
| subfolderopt | STRING | — | |
| filenameopt | STRING | — | |
| totalopt | INT | 0 | — |
Outputs (0)
No outputs