Nodes/Save Image with Selective Metadata/Save Image (Selective Metadata)
ComfyUI Node

Save Image (Selective Metadata)

Want Clean Metadata? This Save Node Leaves the Workflow Out

By brucew4yn3rp·Created about a year ago·Updated about a year ago· 1
Save Image (Selective Metadata)
  • images
    filename_prefixComfyUI
    key_1
    metadata_1
    key_2
    metadata_2
    key_3
    metadata_3
    key_4
    metadata_4
    key_5
    metadata_5

    You know how every ComfyUI PNG quietly drags its entire workflow around inside the file metadata? Drag one back onto the canvas and the whole graph reconstructs itself. That's the party trick that made "workflow included" a community norm. This node is the opposite: it saves your image with only the metadata you choose, and the workflow stays home. On purpose.

    That's the whole deal. Save Image (Selective Metadata) from brucew4yn3rp/ComfyUI_SelectiveMetadata is a drop-in replacement for the stock Save Image node that writes nothing automatically. Instead of embedding the graph JSON, it writes up to five key/value text pairs that you feed in - and if a key is empty, that pair is silently skipped.

    Why would you want that? The most common reason is saving your prompt in a clean, readable form instead of buried in JSON. Type your prompt into a String node, run the same text into both CLIP Text Encode (Prompt) and this node, and the PNG carries a plain "prompt" text chunk anyone can read in a metadata viewer. It's also a neat privacy move: share an image without leaking your exact pipeline or letting someone reconstruct your setup. Some people are legitimately protective of their workflows, and this is the polite way to hand over the result without the recipe.

    How it works

    Under the hood it's not magic - just a fork of the stock save logic. Each image becomes a PNG (the filename pattern is {prefix}_{counter:05}_.png, same as core ComfyUI), and the pairs you supply get written via Pillow's PngInfo.add_text as standard text chunks. It even respects ComfyUI's --disable-metadata startup flag, so if you've turned metadata off globally, nothing gets written at all.

    One honest warning about the description: it says "PNG or WebP," but the code hardcodes .png. The WebP quality settings sitting in the source are dead code. It's PNG or PNG - there's no format input. The description is a fib, the code is the truth.

    Inputs that matter

    • images - the batch you want saved. Required.
    • filename_prefix - default ComfyUI. This is your output prefix/folder.
    • key_1 … key_5 and metadata_1 … metadata_5 - the pairs. Wire a String node (like the bundled Multiline String) into, say, key_1 = "prompt" and metadata_1 = your prompt text, then key_2 = "seed" / metadata_2 = seed, and so on. Empty key, pair dropped.

    It has no outputs - it's an output node. Files land in ComfyUI/output and appear in the UI's history.

    Install

    Two ways, both trivial - this pack has no model downloads and only numpy + Pillow as dependencies, which you already have.

    Via ComfyUI Manager, search "Save Image with Selective Metadata" and click install. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/brucew4yn3rp/ComfyUI_SelectiveMetadata/
    cd ComfyUI_SelectiveMetadata
    pip install -r requirements.txt   # activate your venv first if you use one
    

    Then restart ComfyUI.

    Where people get burned

    The big one: images saved by this node will not reload as workflows. If you drag one back into ComfyUI, nothing reconstructs. That's the feature, but it's permanent - don't use this node on images you still want to edit, and save the workflow JSON separately if you might need it later. Also remember it's capped at five pairs, it only writes PNG, and the metadata is plain readable text (not hidden or encrypted). If your pairs show up missing, check that the keys aren't empty or whitespace - that's the drop condition. And if a downloaded workflow complains about a missing node, that's this pack not being installed; Manager's "Install Missing Custom Nodes" sorts it in one click.

    It's a small, single-purpose tool with one loud opinion about your metadata. If you like clean PNGs and don't need the graph to travel with your images, it's exactly the save node you were looking for.

    Categoryimage

    Inputs (12)

    NameTypeDefaultDescription
    imagesIMAGEThe images to save.
    filename_prefixSTRINGComfyUIThe prefix for the file to save.
    key_1optSTRINGMetadata key 1
    metadata_1optSTRINGMetadata value 1
    key_2optSTRINGMetadata key 2
    metadata_2optSTRINGMetadata value 2
    key_3optSTRINGMetadata key 3
    metadata_3optSTRINGMetadata value 3
    key_4optSTRINGMetadata key 4
    metadata_4optSTRINGMetadata value 4
    key_5optSTRINGMetadata key 5
    metadata_5optSTRINGMetadata value 5

    Outputs (0)

    No outputs