Nodes/ComfyUI-TinyBee/Save Image Batch to Zip
ComfyUI Node

Save Image Batch to Zip

Hand someone all 64 frames as one file

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Save Image Batch to Zip
  • image_batch
  • polyglot_img
    filename_prefixbatch
    compress_to_ziptrue
    json_filenamemetadata.json
    json

    Every batch workflow ends the same way: the KSampler spits out a batch of images and you're left with a folder full of loose PNGs to package up before you can send them anywhere. Save Image Batch to Zip cuts that step out - it takes an IMAGE batch straight off the wire and writes it into a single zip archive in your output folder. Fifty frames, one file.

    That's the use case in one line: handoffs. Animation frame passes, batch of style variants you want to drop into a chat or a Google Drive folder, a dataset you're about to move somewhere. One zip beats forty loose files every time. If you don't actually want a zip, the same node flips into "export as folder" mode with a boolean, so you get the naming logic either way.

    How it works

    The node loops over every image in the batch tensor, converts each to a PNG, and stuffs them into a zip - in memory, then written to disk. It uses ComfyUI's own save-image path logic (folder_paths.get_save_image_path), so the file lands in your standard ComfyUI/output directory and gets a counter suffix if the name already exists. Nothing exotic, nothing external: it's pure stdlib zipfile plus the PIL that ComfyUI already ships.

    The inputs that actually matter:

    • image_batch (IMAGE) - the batch to package. This is the only required "real" input.
    • filename_prefix (STRING, default batch) - base name; you'll get something like batch_00001_.zip in output.
    • compress_to_zip (BOOLEAN, default on) - leave on for a .zip; switch off and it saves the same images as a numbered folder of PNGs instead.
    • json_filename and json (optional) - if you pass a JSON string in the json box, it's written into the archive as metadata.json (or whatever name you give). Great for tagging a batch with its prompt or settings before you hand it off.

    There are no data outputs - it's an output node, which means it has side effects and you wire nothing out of it. The file is the result.

    Installing it

    This is one node in ComfyUI-TinyBee, a small MIT-licensed utility pack with no models to download. The easy path:

    1. ComfyUI Manager → Custom Nodes Manager.
    2. Search "ComfyUI-TinyBee" and install.
    3. Restart ComfyUI.

    Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
    

    Restart, and it sits under 🐝TinyBee/Queue. Its only listed dependencies are pillow and jsonata; jsonata is only needed by the pack's JSON Parser node, so for this node you're using things ComfyUI already has.

    Gotchas

    Two things to remember. First, the node always re-runs when queued (IS_CHANGED forces it), so you won't lose an export to caching - but that also means every queue produces a new file, and filename collisions get the standard counter treatment. Second, the json input is a raw string, not a structured object: if you're wiring a JSON object from another node, you'll need to stringify it first. And the zip holds PNGs, not your original format - if you're dealing with huge batches, expect the archive to be chunky. For a leaner alternative, the pack's Randomize Image Batch node can shuffle the batch order before you save, which is handy when you want the zip's contents in a different order without touching the generation.

    Category🐝TinyBee/Queue

    Inputs (6)

    NameTypeDefaultDescription
    image_batchIMAGE
    filename_prefixSTRINGbatch
    compress_to_zipBOOLEANtrue
    json_filenameoptSTRINGmetadata.json
    jsonoptSTRING
    polyglot_imgoptIMAGE

    Outputs (0)

    No outputs