Read Region UV Metadata From Image
That PNG carries region outlines you can't see — this node drags them back out
- image
- preview_image
- metadata_json
- has_metadata
The writing side of this pack (Detect + Save) buries object polygons inside PNG text chunks or WebP EXIF - which means a file that looks like a plain image can secretly know where every person and car is. Read Region UV Metadata From Image is the node that gets that back out: point it at a PNG or WebP and it redraws the regions on a preview, returns the raw JSON, and tells you whether the field was there at all.
It's the verification half of the workflow, and honestly it's the node you'll reach for first when something doesn't round-trip. "Why didn't my saved file have regions?" - run this on it and you'll know in one run instead of guessing.
How it works
Note the input type: this node takes a file picker, not an IMAGE tensor. It opens the actual file with Pillow, reads the embedded metadata from image.info (PNG text chunks) and from the EXIF ImageDescription/UserComment fields (WebP), then looks up whatever field name you ask for. If it finds it, it decodes the JSON, draws the polygons back over the image, and emits both the clean original and the annotated preview.
Two details make it behave well in a graph: IS_CHANGED keys off the file's modification time and size, so the node re-runs when you swap the file (and only then), and VALIDATE_INPUTS catches a deleted/missing file before the run starts. It also runs without any of the pack's heavy models - no Grounding DINO, no SAM2 - because reading metadata is pure parsing. First-run model download is a non-issue here.
Inputs and outputs
Inputs: image (pick or upload a PNG/WebP), metadata_field (default region_uv_vertices - change it if you saved under a custom key), and line_thickness / font_scale which only affect the preview drawing, not the parse.
Outputs:
image- the original file as a tensor, so you can pass it downstream.preview_image- the same image with detected regions outlined and labeled. This is the "show me" output.metadata_json- the full decoded payload, pretty-printed JSON, or an empty string if nothing was found.has_metadata- the boolean you'd wire into a switch: true if the field existed and parsed.
The has_metadata output is what makes this composable rather than just a viewer - you can branch on it, or use metadata_json as the raw data feed for whatever consumes the region polygons.
Install
It ships in the same pack as the Detect node, so installation is identical: ComfyUI Manager (search "comfyui_region_uv_metadata") or
cd ComfyUI/custom_nodes
git clone https://github.com/csonxx/comfyui_region_uv_metadata
pip install -r ComfyUI/custom_nodes/comfyui_region_uv_metadata/requirements.txt
then restart; it appears under Image/Metadata as "Read Region UV Metadata From Image."
Troubleshooting
has_metadatacomes back false on a file you know was saved with regions → check the metadata field name. If you renamedmetadata_fieldat save time, the reader defaults toregion_uv_verticesand won't find it. Then check the ComfyUI--disable-metadatasetting - if that was on during the save, the payload never landed.- File was re-encoded → any host that recompresses (Reddit, most CDN thumbnails) strips text chunks and EXIF. There's nothing to read; grab the original file.
- Batch images read as one preview → the reader shows the first frame of a multi-frame file. That's a viewing limitation, not a data-loss bug.
- WebP comes back with regions missing but PNG works → verify the file was saved by this pack's save node; a WebP saved by other tools won't have the EXIF payload. This reader only finds what this ecosystem wrote.
One tip from running it: pair it with the Detect node in a feedback loop - read a saved file, and the preview_image tells you instantly whether the polygon simplification or min-area filter was too aggressive. You get the diagnosis without rerunning detection.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 1 options: example.png | |
| metadata_field | STRING | region_uv_vertices | — |
| line_thickness | INT | 21–12 | — |
| font_scale | FLOAT | 0.700.3–3 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| preview_image | IMAGE | — |
| metadata_json | STRING | — |
| has_metadata | BOOLEAN | — |