Nodes/ComfyUI-Aaalice-Nodes/🧾 Load Image with Metadata
ComfyUI Node

🧾 Load Image with Metadata

The Load Image that stops throwing your metadata away

By Aaalice233·Created 2 months ago·Updated a day ago· 21
🧾 Load Image with Metadata
    • image
    • mask
    • metadata
    image

    The stock Load Image node is wasteful in a quiet way: it opens a PNG, keeps the pixels, and throws away the part of the file that explains how the image was made. Every ComfyUI output embeds its prompt, seed, and full workflow in the file's text chunks - that's the whole trick behind the "workflow included" sharing culture. Load Image (Metadata) is the same loader with a third output that hands you all of that as a JSON string.

    Reach for it when someone posts an image and you want to know how it was built. Core Load Image gives you pixels and a blank stare. This node gives you the generation info in one string you can read, feed to a JSON/text node, or pass along to the pack's Set Image Metadata so the info survives a re-save.

    How it works

    Open the file, grab img.info - every PNG text chunk, keys like prompt, workflow, parameters, whatever the writing app stashed in there - and serialize it to a pretty-printed JSON string. That's the whole mechanism; it doesn't parse or interpret anything, it's an honest dump of the file's metadata. Under the hood it also attaches that same string to the output tensor as a hidden _metadata attribute, which is how the pack's metadata can "travel" to Save Image (Metadata) later without you retyping it.

    Inputs and outputs

    • image - pick or upload from ComfyUI's input folder, exactly like core Load Image. That's the only input.
    • image (IMAGE) - the pixels, converted to RGB.
    • mask (MASK) - the alpha channel if the file has one, in ComfyUI's inverted mask convention; an empty all-zero mask if not.
    • metadata (STRING) - the JSON dump.

    The metadata output is a string, not a parsed object. If you want individual fields, feed it to a JSON-parse node or a text viewer. Think of it as ComfyUI's universal metadata currency - plenty of the ecosystem works in raw strings, and this slot right into that.

    Installing

    Same as any custom node pack. Easiest: ComfyUI Manager, search "Metadata Tools", install, restart.

    cd ComfyUI/custom_nodes
    git clone https://github.com/0nikod/ComfyUI-Metadata-Tools
    

    Then restart ComfyUI, running pip install -r requirements.txt if the environment demands it. Watch the copy-paste: the README's own snippet has a typo - it says dniko0/ instead of 0nikod/ and will 404. The only declared dependency is Pillow, which ComfyUI already ships, so there's nothing heavy to download and no model files. It's a small solo pack (MIT, English + Chinese UI), which is fine - it does one thing.

    Troubleshooting

    • metadata comes back {}. The file genuinely has no text chunks - a screenshot, a JPEG, or a PNG an editor re-saved after stripping metadata. Not a bug; the info simply isn't there.
    • You expected the prompt but only see parameters or UserMetadata. Different tools write different keys: ComfyUI writes prompt and workflow, A1111 writes parameters. This node doesn't interpret, it dumps - read the keys that match whoever made the file.
    • The mask is a flat zero tensor for images without alpha. That's the "no transparency" signal, same convention as core Load Image - don't wire it into an alpha-keyed operation expecting detail.
    CategoryAaalice/tools

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBOInput image to load. Images can also be uploaded or dropped here.

    Outputs (3)

    NameTypeDescription
    imageIMAGELoaded image pixels.
    maskMASKLoaded alpha mask, matching ComfyUI Load Image behavior.
    metadataMETADATAComplete source parameters, or explicit empty metadata when none exist.