ComfyUI Node

ExposureBracket

The Invisible HDR Problem, Solved in One Node

By DiffusionLight·Created about a year ago·Updated about a year ago· 23
ExposureBracket
  • hdr_image
  • IMAGE
gamma2.40
ev_values0.0,-1.0,-2.0,-3.0,-4.0,-5.0

Here's the annoying truth about HDR images: you can't look at them. Values above 1.0 just clip to white in any normal viewer, so your carefully-merged environment map looks like a blown-out white blob in ComfyUI's preview. ExposureBracket is the fix - it's the exact inverse of Exposure2HDR. Give it one HDR image and it hands you back a batch of ordinary LDR exposures, at whatever EVs you ask for, that you can actually see and save.

In the DiffusionLight workflow it's wired right after SaveHDR, purely so you can inspect what's in the map: three or six preview images showing the scene at different stops. But it's genuinely useful on its own. Every time you produce an HDR map you'll want to double-check that the highlight detail survived and the shadows aren't crushed, and this is the cheapest way to do it.

How it works

For each EV you give it, the node applies (hdr × 2^ev) ^ (1/gamma) and clamps to [0, 1]. That's it - a brightness shift followed by gamma decoding back to display space. It's intentionally lossy (clamping throws away whatever falls outside each bracket's range), so don't treat it as a round-trip with Exposure2HDR. It's a preview and export tool, not a codec.

The inputs that matter

  • hdr_image - the HDR map. In the reference workflow this is SaveHDR's passthrough output.
  • ev_values - a comma-separated string of EVs, default "0.0,-1.0,-2.0,-3.0,-4.0,-5.0" (six brackets). Each becomes one output frame.
  • gamma - default 2.4. Match this to whatever gamma was used to create the HDR, or your preview will be a few stops off.

The output is an IMAGE batch - one frame per EV, in the order you listed them. Wire it into a PreviewImage, or save the frames individually if you want LDR exports for compositing.

Installing it

Same pack as the rest of DiffusionLight-ComfyUI: ComfyUI Manager → search "DiffusionLight", or git clone https://github.com/DiffusionLight/DiffusionLight-ComfyUI into ComfyUI/custom_nodes and restart. Zero extra Python deps - it's numpy and torch, both already present. The heavier stuff (comfyui_controlnet_aux, the SDXL checkpoint, depth ControlNet, and the two LoRAs from the README) is only needed for the full pipeline, not for this node.

Gotchas

  • Keep gamma consistent. If your HDR came out of Exposure2HDR at 2.4, previewing it here at 1.0 will look wrong and you'll chase a problem that isn't there.
  • Clipping is expected. A bracket at EV -5 is supposed to show only the highlights; don't read "most of the frame is white" as a bug.
  • The node works on a single HDR input. Feed it a batched exposures stack by mistake and it'll only use the first frame.
Categorysd

Inputs (3)

NameTypeDefaultDescription
hdr_imageIMAGE
gammaFLOAT2.40-1000–1000
ev_valuesSTRING0.0,-1.0,-2.0,-3.0,-4.0,-5.0

Outputs (1)

NameTypeDescription
IMAGEIMAGE