EXR Metadata Reader (MEC)
EXR Metadata Reader (MEC)
- metadata_json
- width
- height
- channels_csv
EXR Metadata Reader (MEC) answers a question you've probably never asked until the day it matters: what is actually in this .exr file? An EXR isn't just an image - it's a container with a header that can hold a channel list, compression type, and arbitrary custom attributes (camera, lens, timecode, shot notes). This node reads that header without decoding a single pixel, which is its whole selling point. It's from the VFX suite of ComfyUI-CustomNodePacks, the ~72-node pack from Code2Collapse (Likhith-24, active on r/comfyui) aimed at making ComfyUI a real compositing step.
When would you reach for it? You downloaded a render pass or a plate and you need to know: is this the beauty pass or the AO pass? Is it compressed with piz (lossless, good for grainy plates) or dwaa (lossy, fine for color)? Does it carry the channels your workflow expects, or did someone flatten it to RGB on the way out? Checking that before loading saves you from the classic mistake of compositing the wrong pass and only noticing after a full pipeline run.
How it works
Two backends, same result:
- OpenEXR (the library) - if installed, it reads the header properly and returns the attributes as structured values.
- Pure-Python parser - if OpenEXR isn't installed (or you flip
force_pure_pythonon to benchmark), it parses the EXR's binary header directly. No dependencies needed. That's a genuinely thoughtful fallback for a format that usually demands a native library.
The info_json output is the prize: the full attribute map - width/height from the dataWindow, the channel list (channels_csv), compression, and every custom attribute in the header. You also get width and height as plain INTs and channels_csv as a comma-separated string, which are handy as wiring, not just eyeball info.
The inputs and outputs that matter
file_path- absolute path to the .exr. Only required input.force_pure_python(optional) - skip OpenEXR even if it's installed. The tooltip calls it "useful for benchmarking"; realistically you'd only use it to test the fallback.metadata_json- the full header dump (STRING).width/height(INT) andchannels_csv(STRING) - convenient scalars you can actually wire downstream, e.g. feeding dimensions into a crop or resize decision.
Installing it
It ships with ComfyUI-CustomNodePacks - there's no standalone repo. Manager → search "CustomNodePacks", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Code2Collapse/ComfyUI-CustomNodePacks.git
No extra dependencies are strictly required, since the pure-Python parser always works. If you want the richer OpenEXR-backed read, pip install OpenEXR Imath in your ComfyUI environment (careful with the pack README's warning about the full requirements.txt - it can clobber ComfyUI's torch). Then restart ComfyUI.
Common issues
- "EXR not found" - the path is checked as-is and must be absolute. No globbing, no relative paths from ComfyUI's input folder.
- OpenEXR import fails on install - it happens (native wheel issues on some Python versions). The pure-Python parser means the node still works; you lose some attribute fidelity but the dimensions and channel list survive.
- Compression shows up empty - some writers don't record it in the way the reader expects; don't panic, the channel list and dimensions are the parts that matter.
The blunt take: most ComfyUI users will never open this node, and that's fine. It exists for the day you're handed an unknown EXR in the middle of a comp workflow and need ground truth fast - and on that day it's exactly the right tool, because it tells you before you commit to decoding.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | Absolute path to a .exr file. | |
| force_pure_pythonopt | BOOLEAN | false | Skip OpenEXR even if installed; useful for benchmarking. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| metadata_json | STRING | — |
| width | INT | — |
| height | INT | — |
| channels_csv | STRING | — |