Nodes/ComfyUI Image Saver/Load Image with Metadata (Image Saver)
ComfyUI Node Runs on cloud

Load Image with Metadata (Image Saver)

Your upscaled PNG forgot its prompt — this loader reads it back out

By alexopus·Created 3 years ago·Updated 12 days ago· 209
Load Image with Metadata (Image Saver)
    • image
    • mask
    • metadata
    • positive
    • negative
    ◄image▾►

    ComfyUI's built-in Load Image gives you pixels. That's it. The prompt that made the picture is sitting right there in the file - in the PNG tEXt chunk, or the EXIF UserComment of a JPEG - and the core node hands none of it back to you as text. So people retype prompts they already own, and the upscale they just saved lands on Civitai with no generation data at all.

    Load Image with Metadata is the fix: Load Image plus the generation metadata stored in the file, exposed as a METADATA output and as plain positive / negative strings. Two jobs. Keep the original parameters when you re-save a processed version, and get the prompt back out of something you generated last month.

    What it actually reads

    It loads the image through ComfyUI's own LoadImage - delegating, not subclassing, so change detection and the file list behave like the core node - then opens the file a second time for metadata, in this order:

    1. An A1111-style parameters string. PNG text chunk for Image Saver, A1111 and Forge; EXIF UserComment for JPEG, WebP and AVIF. This is the good case: prompt, Negative prompt: line, then Steps: 20, Sampler: …, CFG scale: ….
    2. ComfyUI's embedded prompt graph, best-effort, for images saved by other nodes - it walks the API-format graph for literal values upstream of the prompt and sampler nodes.

    Why the fallback exists: ComfyUI's stock save writes the graph but not the flat A1111 string, so plenty of images in the wild only have the graph dialect. That split is the whole reason this pack exists - it writes both, with resource hashes, so Civitai's auto-detect has something to chew on.

    One nice touch: it shows parsed metadata as soon as you pick a file, before anything runs - a table of rows or the raw text, both copyable. It doubles as a prompt viewer, so you can stop screenshotting PNG Info tabs.

    The inputs and outputs that matter

    Inputs, honestly, are one: image, the same combo-and-upload widget as Load Image.

    Outputs, five of them:

    • image - identical to Load Image. Wire it wherever the core node would go: an upscaler, a sampler, a detailer.
    • mask - the alpha channel, same as Load Image.
    • metadata - the interesting one. Connect it to the metadata input of Image Saver Simple (that specific node; the full Image Saver has no such input) and the original A1111 parameters get written into the new file unchanged. Filename variables like %seed and %model also come from the original values, so your upscale lands in a file named after the seed that made it.
    • positive / negative - plain strings, for feeding a second pass or an inpaint without copy-pasting.

    That's the loop: load a 512×768 image, upscale, save - and the 2048×3072 output still knows its checkpoint, its LoRAs and their hashes.

    Installing

    Manager first - search ComfyUI Image Saver. Otherwise:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alexopus/ComfyUI-Image-Saver
    cd ComfyUI-Image-Saver
    pip install -r requirements.txt
    

    Then restart. requirements.txt is one line - piexif - so nothing heavy and no model downloads. This is alexopus's maintained fork of the dormant giriss/comfy-image-saver; if a tutorial points at the old repo, you're on the right one.

    Where people get burned

    The mask editor strips the metadata, and you'll do it by accident. Paint on a saved image and ComfyUI writes a fresh clipspace-*.png built from pixels only. Load that copy and there's nothing to find - the node detects it and warns in the console.

    Images that only have the workflow are readable, not editable. The graph parse gives plausible prompts and settings, but the metadata output carries no A1111 parameters to write, so re-saving one of those writes no parameters block. Limit of the source file, not a bug.

    Anything that re-encodes the image kills it. Reddit re-serves uploads as recompressed derivatives, so a PNG that worked on your disk arrives with its chunks gone. Screenshots never had them. When a prompt won't read, check the bytes you're loading before blaming the node.

    Nothing found means None, quietly. The node warns, then passes None downstream; Image Saver Simple accepts it and saves with empty prompts. Looks like the saver ate your prompt when the loader never had one. Read the console.

    Verdict

    This is the node you reach for the first time you want to upscale something good with the recipe attached, and then it quietly joins every workflow where an image arrives from outside. Pair it with Edit Metadata (Image Saver) when you need to change those parameters instead of passing them through.

    CategoryImageSaver

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (5)

    NameTypeDescription
    imageIMAGEimage (same as Load Image)
    maskMASKmask from the alpha channel (same as Load Image)
    metadataMETADATAgeneration metadata of the file for Image Saver Simple: re-saving keeps the original parameters and resources. Empty if the file has none.
    positiveSTRINGpositive prompt
    negativeSTRINGnegative prompt