Nodes/Sage Utils/Save Image With Metadata
ComfyUI Node

Save Image With Metadata

Bake A1111-style parameters into your PNGs

By arcum42·Created 2 years ago·Updated 18 days ago· 32
Save Image With Metadata
  • images
    filename_prefiximage_
    include_node_metadatatrue
    include_extra_pnginfo_metadatafalse
    save_textfalse
    param_metadata
    extra_metadata

    Stock ComfyUI already embeds your whole workflow into the PNG it saves - great for reopening the graph later, useless for anything that expects the older A1111 metadata convention (a parameters text chunk with prompt, sampler, model hash, etc. in a specific format). A lot of tooling in the wider ecosystem - Civitai's own metadata parser, various gallery tools, other A1111-lineage apps - reads that parameters field specifically, not ComfyUI's JSON graph. This node is Sage Utils' answer: a Save Image node with two extra text inputs for exactly that purpose.

    How it fits together

    This node isn't meant to build the metadata string itself - it's the endpoint. The README lays out the intended pipeline: you build a metadata string upstream (from a "Construct Metadata" or "Construct Metadata Lite" node, pulling in model info, LoRA stack details, sampler settings, image size - whatever you've got wired up), and feed the result into param_metadata here. Anything else you want tacked on - notes, a run label, whatever - goes into extra_metadata, which lands in the PNG's extra field rather than parameters.

    The inputs that matter

    • images - required, what you're saving.
    • filename_prefix - default image_, same idea as the stock Save Image node.
    • include_node_metadata - on by default; controls whether ComfyUI's own standard workflow metadata still gets embedded alongside your custom stuff. Turn it off if you specifically don't want the full graph baked into the file (smaller files, or you don't want to expose your workflow).
    • include_extra_pnginfo_metadata - off by default; a second, more granular switch for extra PNG info metadata.
    • save_text - off by default; also write a companion .txt file alongside the image with the same metadata, for anyone who wants it human-readable without a PNG metadata viewer.
    • param_metadata - the A1111-style string, meant to come from a Construct Metadata node upstream.
    • extra_metadata - free-form extra text.

    There's no output - this is a terminal node (is_output_node), it just writes files to disk.

    Installing it

    Through ComfyUI Manager: search Sage Utils, install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/arcum42/ComfyUI_SageUtils
    cd ComfyUI_SageUtils
    pip install -r requirements.txt
    

    Restart ComfyUI. No model downloads needed for this specific node - it's pure metadata plumbing, the dependency install covers the pack as a whole.

    Common issues

    The most common mistake is treating this as a drop-in Save Image replacement and leaving param_metadata empty - at that point you've just got a slightly heavier Save Image node with none of the actual point. You need something upstream constructing that string; a bare text widget with your prompt typed in works in a pinch, but the pack's own metadata-construction nodes are built to produce the right A1111-compatible format automatically.

    Second: if you're relying on external tools to read the embedded metadata and they're not picking anything up, check whether include_node_metadata and your param_metadata string actually landed where you expect - ComfyUI's own workflow JSON and the A1111-style parameters field are two separate chunks in the same PNG, and different tools look at different ones. If a tool reads A1111 metadata specifically, it's your param_metadata field it cares about, not the workflow JSON.

    CategorySage Utils/image/file

    Inputs (7)

    NameTypeDefaultDescription
    imagesIMAGEThe images to save.
    filename_prefixSTRINGimage_The prefix for the saved image filenames.
    include_node_metadataBOOLEANtrueWhether to include node metadata in the saved image.
    include_extra_pnginfo_metadataBOOLEANfalseWhether to include extra PNG info metadata.
    save_textBOOLEANfalseWhether to save accompanying text files with metadata.
    param_metadataSTRINGThe metadata to embed in the image.
    extra_metadataSTRINGAny extra metadata to include.

    Outputs (0)

    No outputs