Nodes/ComfyUI_ColorMod/Create HDR image
ComfyUI Node

Create HDR image

Fake HDR from three diffusion passes — and yes, it needs trial and error

By city96·Created 3 years ago·Updated 2 years ago· 111
Create HDR image
  • image_a
  • image_b
  • image_c
  • IMAGE
exposure_a1.0
exposure_b2.5
exposure_c8.0

In real photography, HDR means taking the same scene at three exposures - one dark, one mid, one bright - and merging them so no area is clipped. This node does that for generated images. You feed it three versions of the same picture at different brightnesses, it treats them like exposure-bracketed photos, and it merges them into a true HDR image with values beyond [0, 1]. Then you tonemap that back down to something you can actually look at. It's the most fiddly node in this pack, but it's the one that makes the whole HDR pipeline go.

How it works

The three inputs go through OpenCV's Debevec calibration (createCalibrateDebevec) to estimate a camera response curve, then createMergeDebevec fuses them using the exposure values you supplied. The output is floating-point HDR - highlights can sit above 1.0, shadows below 0, and nothing has been clipped yet.

The exposure_a/b/c values are where the "fake" comes in. A real camera knows its shutter speeds; diffusion doesn't have a shutter. So you're telling the merge algorithm what exposure each pass represents, and the defaults (1, 2.5, 8) are guesses. The README is upfront: "realistically, there is no exposure with generated images so these values will have to be guessed."

Inputs and output

  • image_a, image_b, image_c - three IMAGEs, same resolution, same content at different brightness. All three are required.
  • exposure_a (1.0), exposure_b (2.5), exposure_c (8.0) - the assumed exposures. Wider gaps give a wider dynamic range but also more room for the merge to look wrong.
  • Output: IMAGE, the HDR result.

A workflow that actually works

  1. Generate the scene once at normal brightness.
  2. Re-generate it darker and brighter. The README's recommended approach: separate diffusion passes at different brightness, and use ControlNet or similar conditioning to stop the passes from diverging - otherwise the different versions drift in composition and the recombined image gets artifacts.
  3. Merge with Create HDR image, then tonemap the result back to SDR before anything else sees it.

Installing

From the ColorMod pack, needs OpenCV:

cd ComfyUI/custom_nodes
git clone https://github.com/city96/ComfyUI_ColorMod
cd ComfyUI_ColorMod
pip install -r requirements.txt

Restart, or install via ComfyUI Manager. If the node is missing, opencv isn't installed.

Where it bites

  • The three inputs must be the same resolution and batch size. The node asserts this and throws a "Batch size mismatch!" error if not.
  • It's slow-ish and guessy. Debevec calibration + merge per batch. Plan on iterating the exposure values.
  • HDR out → tonemap before the VAE. Leaving values above 1.0 near a sampler invites weird behavior. If you want a clean merged SDR without the HDR middle step at all, this pack's Exposure Fusion node skips calibration entirely and is much less fiddly - try that first if Create HDR image feels like a black box.
CategoryColorMod/hdr

Inputs (6)

NameTypeDefaultDescription
image_aIMAGE
image_bIMAGE
image_cIMAGE
exposure_aFLOAT1.00.001–1024
exposure_bFLOAT2.50.001–1024
exposure_cFLOAT8.00.001–1024

Outputs (1)

NameTypeDescription
IMAGEIMAGE