Nodes/PG Nodes/Just Save Image
ComfyUI Node

Just Save Image

A save node that only saves when you say so

By GizmoR13·Created 11 months ago·Updated 11 months ago· 16
Just Save Image
  • image
    savefalse

    ComfyUI's default SaveImage writes every image you generate, every time. Sounds harmless until you're batch-running variations and your output folder is a landfill of 400 near-identical PNGs. PgJustSaveImage is the minimal fix: it only saves to disk when a save boolean is ON, and it saves without previewing - which is faster and, if you're looping, keeps the UI from grinding on a stream of thumbnails.

    This is a "quality-of-life utility," the kind of small node people install a whole pack for without ever posting about it. It's an output node: IMAGE in, nothing out, done. You keep it in the graph purely for the side effect of writing files when you actually want files.

    How it works

    The mechanism is intentionally boring. If save is true, the node writes every frame in the IMAGE batch to ComfyUI's output directory as <prefix>_<counter>_.png (default prefix ComfyUI), with a counter that continues from the highest existing number so it never overwrites. It embeds the usual metadata - the workflow and prompt JSON - into the PNG, so you can drag the file back into ComfyUI and rebuild the graph. It uses PIL's PNG writer with a modest compression level, which is why it feels snappier than the stock saver on big batches.

    The input side is just image (an IMAGE batch) and save (boolean, default false - nothing gets written until you explicitly turn it on). Wire the toggle to a primitive, or drive it from another node if you want saving to depend on something.

    Install

    Part of PG Nodes: ComfyUI Manager → "PG Nodes" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/GizmoR13/PG-Nodes
    

    No models, no extra dependencies.

    Common issues

    People forget the default is OFF and wonder where their images went - if nothing appears in ComfyUI/output, check save. The counter scans for existing ComfyUI_*.png files in the output folder, so if you've renamed files or used a different prefix, numbering may restart from zero and overwrite nothing but surprise you with reused names. And it writes PNGs only - there's no JPEG option here, so if disk space is the concern you're trading preview speed, not file size. If you need the image to continue down the graph after saving, use the sibling PgJustSaveImageOut instead; this one terminates.

    CategoryPG/Utils

    Inputs (2)

    NameTypeDefaultDescription
    imageIMAGE
    saveBOOLEANfalse

    Outputs (0)

    No outputs