📝 Image Metadata Loader
Load an image and keep its metadata in the graph — not just its pixels
- IMAGE
- METADATA
- MASK
ComfyUI's stock Load Image throws away the file's metadata the moment it decodes the pixels. Usually you don't care. But when you're upscaling or editing an image that has generation data baked into the PNG - prompt, sampler, seed, LoRA list - throwing it away means the finished image you post to Civitai has nothing but pixels to its name. The 📝 Image Metadata Loader is the "load the pixels and the metadata" version: it reads the image out of your input folder and hands you the image tensor, the raw metadata, and a mask all at once.
How it works
It opens the file with PIL and grabs img.info - that's the PNG text chunks where generation tools stash everything - then decodes the frames the same way ComfyUI's core loader does. Metadata comes out verbatim as a METADATA object you can pass along. Alpha gets converted into a MASK output using ComfyUI's standard inverted-alpha convention (transparent pixels become mask 1), and multi-frame images like GIFs are stacked into a batch. It handles EXIF orientation via exif_transpose too, so photos don't come in sideways.
The useful detail is what you do with the METADATA output: wire it straight into this pack's 📝 Image Metadata Saver and the original metadata is re-embedded unchanged into the PNG you save. That's the whole upscale-without-losing-generation-info loop, done with two nodes and zero manual copying.
Inputs and outputs
The only input is image - a dropdown of images in your input directory (with an upload button, same as the stock loader). Outputs:
- IMAGE - the decoded pixels, ready for processing.
- METADATA - the raw metadata dict from the file.
- MASK - alpha-derived mask; a blank 64×64 zero mask if the image has no alpha, exactly like core ComfyUI.
Caveats
Two honest ones. First, "metadata" here means whatever the file actually contains - this node doesn't parse or normalize anything, so a Civitai/A1111-style parameters string stays a raw string until something interprets it. Second, only PNG (and other PIL-readable formats) reliably carry metadata in the first place; a re-encoded JPEG or a screenshot has nothing to grab, and you'll get an empty dict rather than an error.
This is also one of the two nodes the pack's README warns about specifically: it used to ship standalone as ComfyUI-Image-Metadata-Nodes. If you have that repo installed, delete it from custom_nodes - otherwise ComfyUI will complain about duplicate node registration alongside this pack.
Install
Light-x02 Nodes via ComfyUI Manager (search "ComfyUI-Lightx02-Nodes"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/Light-x02/ComfyUI-Lightx02-Nodes
Restart ComfyUI. No extra dependencies beyond Pillow, which ComfyUI already has.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| METADATA | METADATA | — |
| MASK | MASK | — |