Get Image Metadata
Read the metadata tag before the pipeline drops it
- image
- metadata
Set Image Metadata and Load Image (Metadata) attach a string to the image tensor. Get Image Metadata is how you read it back mid-workflow - an IMAGE in, a STRING out, nothing else. If you want to inspect what's riding along, log it to a text node, or feed it into a JSON chain, this is the node.
It exists because ComfyUI has no native way to see this kind of attribute. The metadata travels invisibly on the tensor, and without Get you'd have no way to check whether it survived the trip. That's the whole point of the pack's four-node design: set it, carry it, read it, save it.
How it works
One line, essentially: read the _metadata attribute off the tensor and return it, or an empty string if it's not there. There's no parsing and no file access - it's reading an attribute on a Python object. Which is also the entire gotcha. The attribute only exists if the tensor came from this pack's Set or Load nodes, and it only survives as long as the exact tensor object survives. Any node in between that rebuilds the tensor - a resize, a batch concat, an encode/decode round-trip - silently drops it, and Get just returns "".
Inputs and outputs
image- any IMAGE tensor that (hopefully) carries the attribute.- Output:
metadata- the string, or""if nothing is attached.
Wire the output into a "show text"-style node to actually see it, or into a text/JSON chain for further processing.
Installing
Same pack, same steps as the rest: ComfyUI Manager, search "Metadata Tools", install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/0nikod/ComfyUI-Metadata-Tools
Restart ComfyUI afterward. The README's clone snippet contains a typo - it says dniko0/ instead of 0nikod/ and will 404 - and the only declared dependency is Pillow, which ComfyUI already ships.
Troubleshooting
- Empty output everywhere. The attribute is gone or was never set. Trace the wire back and check that nothing between Set/Load and Get rebuilds the tensor. The empty string is silent on purpose - easy to mistake "no metadata" for "worked fine."
- It only sees what this pack attaches. Metadata sitting in the PNG file isn't magically on the tensor. You need Load Image (Metadata) to pull it out of the file first, or Set Image Metadata to put it on the tensor.
- The output is exactly what you set. If you want fields you can query, the upstream Set node needs a JSON string - Get won't parse it for you, so parse after this node if you need structure.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| metadata | STRING | — |