Nodes/radiance/HDR Highlight Composite
ComfyUI Node

HDR Highlight Composite

Only the blown-out parts come from the model

By FXTD-Studios·Created 8 months ago·Updated about 18 hours ago· 246
HDR Highlight Composite
  • original_image
  • hdr_image
  • clip_mask
  • image
◄inverse_eotfsRGB►
◄blend_softness24►
◄highlight_strength1.00►

There's a hard rule in this pack's whole SDR-to-HDR design, and this node is where it's enforced: never let the model touch pixels that didn't need fixing. A diffusion model asked to expand an SDR image into HDR will happily redraw everything it's given, subtly. So instead, you detect the clipped regions, run the model, and composite the result back only where the original had no information left.

HDR Highlight Composite is that final step, and it's the same structural instinct as crop-and-stitch inpainting: prove that untouched pixels stayed untouched. Outside the mask, the output is the original linearised SDR, pixel for pixel. Inside, it's the AI reconstruction. No compromise in the middle.

How it works

Three things happen. The original SDR image is linearised using inverse_eotf, so it lives in the same scene-linear space as the model's output - otherwise you'd get a tonal step at the seam. Then clip_mask guides the blend: 1 takes hdr_image, 0 keeps the original. Finally the edge is feathered by blend_softness so there's no hard line where the composite changes source.

If hdr_image arrives at a different size, it's bilinearly resized to match the original, so you can run the reconstruction at a resolution the model prefers and still composite cleanly. Alpha is carried from the original.

Inputs and outputs

Required: original_image (the display-encoded SDR you started with), hdr_image (scene-linear reconstruction from the model path), and clip_mask - which comes from the pack's Clip Detector node, not from this one. That's the partner node: the mask marks where the source was clipped, which is precisely where the model is allowed to contribute.

Optional: inverse_eotf, with four options - sRGB, Rec.709, Gamma 2.2, Linear (no-op). Set it to match whatever SDR to HDR Prepare was set to upstream. If one says sRGB and the other says Gamma 2.2, you've linearised the two halves differently and the seam won't be subtle.

Then blend_softness (default 24 pixels - 0 gives a hard cut) and highlight_strength (default 1.0, "how much of the AI reconstruction to use").

One output: image, scene-linear HDR, ready for EXR save or further grading.

Install

Manager → search Radiance → Install → restart ComfyUI → refresh the browser. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/fxtd-studios/radiance.git
cd radiance
python -m pip install -r requirements.txt

Windows portable users: python_embeded\python.exe. No models for this node - but the SDR→HDR nodes that feed it will download the RUDRA weights on first use unless downloads are disabled, and the RUDRA weights are separately licensed for non-commercial use. Read that licence before shipping anything.

Where people get burned

Mismatched inverse_eotf is the number one failure, and it presents as a visible tonal discontinuity around the composite edges - like a halo where the model's contribution starts. There's no error, just a seam that gets blamed on blend_softness.

blend_softness of 0 will hand you an obvious hard edge, and it's tempting to drop it there for "precision." 24 pixels exists because highlight roll-off is gradual; a hard cut reads as a sticker.

A bad clip_mask ruins the whole approach. The node trusts it completely - mask everything and you've just replaced your original with a model pass, which is exactly what this pipeline was built to avoid. If the Clip Detector flagged a sky that wasn't really clipped, you'll feel it here as a softer, invented sky.

And the general Radiance preview reminder: output is scene-linear, so it will look flat and odd in an ordinary preview until you tone-map it.

CategoryFXTD STUDIOS/Radiance/HDR

Inputs (6)

NameTypeDefaultDescription
original_imageIMAGEOriginal display-encoded SDR image. Linearised with inverse_eotf and used outside the mask; its alpha is carried to the output.
hdr_imageIMAGEScene-linear HDR reconstruction (e.g. from HDR Decoder). Used inside the mask; resized bilinearly if its size differs from original_image.
clip_maskMASKBlend guide from Clip Detector: 1 takes hdr_image, 0 keeps the original.
inverse_eotfoptCOMBOsRGBTransfer curve of original_image, used to linearise it so it matches hdr_image. Use the same setting as SDR to HDR Prepare.
blend_softnessoptINT240–128Feathering on composite edge in pixels. 0 = hard cut.
highlight_strengthoptFLOAT1.000–1How much of the AI highlight reconstruction to use. 1.0 = full.

Outputs (1)

NameTypeDescription
imageIMAGE—