Nodes/YG Custom Nodes/YG ZIP Image Saver
ComfyUI Node

YG ZIP Image Saver

Collect your batch results into one ZIP, subfolders intact

By mallikarjunaraokoliparthi·Created 2 months ago·Updated about a month ago· 0
YG ZIP Image Saver
  • images
    folder_name
    filename
    is_last
    job_idmy_zip_job
    current_index0
    total_count1

    Run a batch job in ComfyUI and the payoff is usually "a folder with two hundred PNGs." YG ZIP Image Saver is the node that turns that pile into one clean, downloadable ZIP at the end of the run - while remembering where each image came from. It's the natural partner to YG ZIP Image Loader: loader feeds one image per run, your pipeline processes it, and the saver puts each result back into the same sub-folder structure the ZIP started with. When the last image lands, it zips the whole job and shows you a download button.

    How it works

    The saver is a pure output node - no outputs of its own, it just records what it's given. On each run it receives the processed images, plus folder_name and filename forwarded from the loader, and writes the result as a lossless PNG into ComfyUI/output/yg_zip_output/<job_id>/<folder_name>/. The PNG conversion mirrors ComfyUI's built-in SaveImage, so what you get is the standard 255.0 * tensor round-trip - nothing weird happening to your colors.

    The batch logic is driven entirely by is_last: the loader flips it true on the final image, and that's the saver's cue to walk the whole job folder, compress it into <job_id>_bg_removed.zip, and notify the frontend so a download button appears. If a run is interrupted before the last image, there's a "Create ZIP Now" button that packages whatever has been saved so far - a genuinely useful recovery path.

    The inputs you wire

    The four required ones are the wiring contract between loader and saver:

    • images - your processed batch result.
    • folder_name / filename - come straight from the loader's matching outputs. They're forceInput, so they must be wired, and they're what preserves the original sub-folder layout.
    • is_last - also from the loader; decides when to build the ZIP.
    • job_id - must match the loader's job_id exactly, or the two nodes are talking about different batches. This is the #1 wiring mistake.

    The optional current_index / total_count are just for progress display in the UI; you can ignore them.

    Installing it

    It's part of comfyui_yg_nodes (MIT, "YG Custom Nodes" v1.0.4 by Mallikarjuna Rao Koliparthi) with no extra Python dependencies. Install via ComfyUI Manager (search comfyui_yg_nodes) or clone:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mallikarjunaraokoliparthi/comfyui_yg_nodes.git
    

    Restart ComfyUI; it's under YG Custom Nodes.

    Common issues

    The output ZIP lives at ComfyUI/output/yg_zip_output/<job_id>_bg_removed.zip, and each new full run overwrites the previous one for the same job_id - use a distinct job_id if you want to keep multiple batch results. Restarting ComfyUI clears the saver's in-memory "zip ready" flag, so an old workflow's download button won't work until you re-run at least the final save. And note the saver always writes PNG (lossless, for quality), so if you want JPEG output you'll be re-encoding later - for the typical background-removal pipeline, lossless is the right call and not a bug.

    If you're on this node, the intended loop is loader → processing → saver, and it's one of the few places in the pack where everything is designed to click together: upload a ZIP, run the batch, download the result ZIP, and the folder structure inside never got mangled.

    CategoryYG Custom Nodes

    Inputs (7)

    NameTypeDefaultDescription
    imagesIMAGE
    folder_nameSTRING
    filenameSTRING
    is_lastBOOLEAN
    job_idSTRINGmy_zip_jobMust match the job_id in YG ZIP Image Loader.
    current_indexoptINT0
    total_countoptINT1

    Outputs (0)

    No outputs