Nodes/ComfyUI_Gear/Gear · Load EXR (linear)
ComfyUI Node

Gear · Load EXR (linear)

Get your linear EXR plates into ComfyUI with the highlights intact

By oumad·Created 4 months ago·Updated 4 days ago· 0
Gear · Load EXR (linear)
    • image
    • frame_count
    path/path/to/frames_*.exr
    max_frames0

    ComfyUI's stock Load Image assumes an 8-bit [0,1] picture. That's fine for PNGs and useless for HDR work, because the whole point of an EXR is that values go past 1.0. Gear · Load EXR reads scene-linear HDR frames and - this is the feature - does not clamp them. Float32 in, float32 out, highlights intact.

    If your workflow involves Blender or Poly Haven renders, EXRs you exported from DaVinci Resolve, or the output of a Gear decode node you're round-tripping, this is the door into ComfyUI.

    How it works

    Two inputs, both simple:

    • path - a single file or a glob for sequences, like /path/to/frames_*.exr. The node sorts matches and stacks them into one batch. If nothing matches, it raises FileNotFoundError and tells you, which beats a silent black frame.
    • max_frames - caps how many frames you pull in (0 = no cap, max 4096). Handy for peeking at the first N frames of a long sequence.

    Outputs are image - an [N, H, W, 3] float32 batch in scene-linear values - and frame_count as an INT you can thread into other logic.

    Mechanically it's OpenCV's OpenEXR backend (cv2.imread with IMREAD_UNCHANGED), a BGR→RGB channel flip, and a nan_to_num sanitizing pass (NaN→0, +inf→1e6, -inf→0) so one corrupted frame doesn't poison the whole batch.

    Where it fits

    The natural pairing is Gear · Load EXR → Gear · ACEScct Encode → your [0,1] pipeline. Feed the loader's output to the encode node and pick the right input_space: linear_rec709 for Blender/Poly Haven plates, linear_acescg if your EXR already came out of an ACES pipeline. Or close the loop on the whole pack: decode → grade → save EXR, then reload those files later with this node.

    The one real gotcha

    EXR support in OpenCV is decided at cv2 import time via the OPENCV_IO_ENABLE_OPENEXR env var. The node sets it defensively before importing cv2, but if another custom node has already imported cv2 without the flag, EXR reads can fail - you'll see failed to read EXR. If that happens, the usual suspect is import ordering, and a clean restart of ComfyUI usually fixes it.

    Install via ComfyUI Manager (search ComfyUI_Gear) or git clone https://github.com/oumad/ComfyUI_Gear into ComfyUI/custom_nodes, then pip install -r requirements.txt and restart. Deps are opencv-python, numpy, Pillow - no models, no extra downloads, nothing to babysit.

    CategoryGear/HDR

    Inputs (2)

    NameTypeDefaultDescription
    pathSTRING/path/to/frames_*.exr
    max_framesINT00–4096

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    frame_countINT