Nodes/ComfyUI-zyd232-Nodes/Save Preview Images
ComfyUI Node

Save Preview Images

Format, Quality, Workflow JSON, and Date-Stamped Folders

By zyd232·Created 2 years ago·Updated 3 days ago· 4
Save Preview Images
  • images
    save_imagetrue
    save_workflow_as_jsonfalse
    previewtrue
    format
    quality85
    meta_data_pngtrue
    custom_path
    filename_prefixComfyUI_
    timestamp

    ComfyUI's built-in SaveImage gets the job done, but it's terse. Save Preview Images is the same idea with opinions: PNG or JPG, a quality slider, PNG metadata on or off, date-stamped output folders, workflow-as-JSON export, and a preview-only mode so you can glance at results without committing them to disk. If you're archiving generations, sharing workflows, or just tired of hunting through a flat output/ folder, this is the node that fixes the boring part of the pipeline.

    How it works

    It's an output node - nothing comes out the right side. The images input goes in, files come out, and the preview shows up in the UI. Under the hood it's the standard ComfyUI save path with a few switches:

    • format - png or jpg. PNG compression is driven by the quality slider too (it maps to a compress level), even though the tooltip says "jpg only" - worth knowing because the slider isn't as ignored as the label suggests.
    • meta_data_png - writes the prompt and full workflow into the PNG's text chunks. This is the load-bearing feature, because in this ecosystem the workflow is the project file: image-io-metadata puts it plainly - drag the PNG back onto the canvas and the whole graph rebuilds. Leave this on for anything you might want to reconstruct later.
    • save_workflow_as_json - writes a .json sidecar next to the image with the same name. This is your escape hatch if you're saving JPG (which can't hold PNG metadata chunks): the workflow survives as a separate file.
    • custom_path - a folder, with %date (YYYY-MM-DD) and %time (HH-MM-SS) placeholders, e.g. outputs/%date. The directory is created automatically. Leave it empty for ComfyUI's default output folder.
    • filename_prefix - same placeholders, plus a timestamp mode: second, millisecond, or a plain counter. Existing files get a bumped counter rather than overwritten.
    • preview and save_image - the interesting combo. preview renders a preview into ComfyUI's temp directory so you can see the result on canvas. save_image decides whether anything actually hits disk. Set save_image off, preview on, and you've got a zero-clutter "just show me" node.

    The trap to dodge

    JPG users, this one's for you. JPEG can't hold ComfyUI's workflow chunks - the metadata dies on re-encode, which is why image-io-metadata keeps a running list of everything that strips it. If you save JPG, the workflow is gone from the file unless you also flipped save_workflow_as_json on. Want a self-contained, drag-back-and-rebuild file? Save PNG with meta_data_png enabled. Want small files? JPG plus the JSON sidecar. Pick deliberately.

    Install

    Same as the rest of the pack - ComfyUI Manager (search "ComfyUI-zyd232-Nodes") or:

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

    Restart, find Save Preview Images under zyd232 Nodes. It leans on Pillow and numpy, both already present in any ComfyUI install - no extra dependencies. And the standing caveat for this pack applies: it's built on the newer V3 backend node API, so a too-old ComfyUI won't register it.

    Bottom line

    SaveImage does one thing; this does the same one thing with the switches you'll actually want at some point - format control, date-organized folders, workflow JSON export, and a preview-only mode. It won't make your images better, but it'll make finding them later a lot less painful.

    Categoryzyd232 Nodes

    Inputs (10)

    NameTypeDefaultDescription
    imagesIMAGEImages to save
    save_imageBOOLEANtrueWhether to save the images to disk
    save_workflow_as_jsonBOOLEANfalseWhether to save the workflow as a JSON file
    previewBOOLEANtrueWhether to generate preview images
    formatCOMBOOutput image format
    qualityINT850–100Image quality (jpg only)
    meta_data_pngBOOLEANtrueWhether to write prompt info into PNG metadata
    custom_pathSTRINGCustom save path. Supports date placeholders: the core style %date:yyyy-MM-dd%, or the shorthand %date / %time.
    filename_prefixSTRINGComfyUI_Filename prefix. Supports date placeholders: the core style %date:yyyy-MM-dd%, or the shorthand %date / %time.
    timestampCOMBOFilename timestamp mode

    Outputs (0)

    No outputs