Nodes/radiance/SDR → HDR Analytic (RUDRA)
ComfyUI Node

SDR → HDR Analytic (RUDRA)

Turn an SDR photo or clip into a real HDR master — with no model and no download

By FXTD-Studios·Created 11 months ago·Updated 9 days ago· 264
SDR → HDR Analytic (RUDRA)
  • image
  • region
  • calibration
  • mask
  • source
  • image
  • filled_mask
  • estimated_mask
  • report
  • mattes
  • regions
◄source_curveBT.1886 (graded / broadcast video)►
◄strength1.00►
◄clip_filltrue►
◄highlight_detail1.00►
◄exposure_ev0.00►
◄output_encodingLinear (Rec.709)►
◄clip_peaks►
◄anchortrue►
◄anchor_knee0.90►
◄keep_source_colourtrue►
◄settle_graintrue►
◄peak_nits1000►
◄reference_white_nits203►
◄source_primariesRec.709 / sRGB►

What this actually is

SDR → HDR Analytic is the RUDRA route that runs on arithmetic instead of a model. No checkpoint, no download, no VRAM worth mentioning - it works on a potato and gives the same answer every time, which is not something you can say about anything diffusion-shaped.

That makes it the honest starting point for SDR→HDR in ComfyUI, and it's a better fit for most people than the learned route. A frame that got graded for broadcast has a known curve in it; undoing that curve is a division, not an inference problem. Where the SDR clipped, though, the data is genuinely gone - and this node is careful about the difference between "reconstructed from what survived" and "guessed".

The wider context: ComfyUI hands you 8-bit-ish sRGB-encoded tensors, and a VFX pipeline wants scene-linear float in a wide gamut (the color-management corner of ComfyUI, where OCIO and OpenImageIO live and where community signal is thin because compositors post in VFX channels, not on r/StableDiffusion). This node is the bridge - diffuse white lands on 1.0, which is 203 nits per BT.2408.

How it works

It inverts the curve that made the SDR, then repairs the top end. A channel that clipped while the others didn't gets rebuilt from the survivors. A blown sky gets a smooth fill and a dome from its edge; a lamp or the sun gets a peak and a falloff from the glow around it. Mid-tones are anchored to the source through anchor_knee so the picture doesn't drift, and below the clip your source colour is carried as-is. Nothing is invented as texture - that's the AI Fill node's job, and it says so.

The inputs you'll actually touch

Four of them, in order of how much they matter:

  • source_curve - the single most important menu on the node. BT.1886 is the default and correct for graded or broadcast video and for generated video. Pick ACES / Hable / AgX for CG renders that went through that tone mapper, camera log for a log clip seen through a LUT, and plain clip for a hard white clip. Get this wrong and everything downstream inherits the mistake.
  • highlight_detail - 1 is off; 1.5–2 is the range to judge. It amplifies structure surviving just under white (a sky, a window, an open door). Needs clip_fill on, which it is by default.
  • strength - how much fill. Drop it for fireworks, sparks, or a highlight that only barely clipped.
  • output_encoding - Linear Rec.709 for a grading master, ACEScg / AP0 for ACES work, PQ or HLG for delivery code values (where peak_nits starts mattering).

The rest you can leave alone for a first pass: anchor, keep_source_colour and settle_grain are already on, and they're on for good reasons.

Outputs: image is the master. filled_mask marks where the fill changed something, estimated_mask marks pixels where every channel clipped - read that one as "extrapolation, don't trust it blindly". mattes feeds RUDRA Master Write, and regions is a picture of the pixel classes you can drop into a Preview node. report explains in words what it did, which is rare enough in this ecosystem to be worth mentioning.

Install

The whole pack comes in one go:

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

Or, easier, ComfyUI Manager → search Radiance → Install, then restart and hard-refresh the browser. On Windows portable, use python_embeded\python.exe, not the system python - that's the single most common way this install goes sideways, and it's the same trap as every other pack with real dependencies (the ecosystem's no-isolation pip problem: every pack installs into one shared environment and quietly fights the others).

Nothing downloads for this node. Note the requirements do pull heavy-ish libraries (OpenColorIO, OpenImageIO, OpenEXR, OpenCV, diffusers) because siblings in the pack need them.

Where people get burned

Blacks look crushed → try BT.1886 shadows, but judge it on an HDR display, not your laptop panel. Grain shimmering in flat near-white areas → check settle_grain is still on. A sky that comes out as a flat ceiling → clip_fill off by accident, or strength at 0.

And the classic: this node can output PQ or HLG, but RUDRA Master Write refuses those. Keep the master linear, write PQ with the delivery writers.

CategoryFXTD STUDIOS/Radiance/HDR

Inputs (19)

NameTypeDefaultDescription
imageIMAGESDR still, batch or video frames, sRGB-encoded 0..1 (a ComfyUI IMAGE as decoded).
source_curveCOMBOBT.1886 (graded / broadcast video)How the SDR was made; the master is the inverse of this curve. BT.1886: graded and broadcast video, generated video, RUDRA's default. BT.1886 shadows: try it when the blacks look crushed (judge on an HDR display). ACES / Hable / AgX: CG and games with that tone mapper. Camera log: a log clip viewed through a LUT. Plain clip: video simply clipped at white.
strengthFLOAT1.000–2How much of the clipped-highlight fill: 0 leaves the plain inverse (a flat ceiling where the SDR clipped), 1 is RUDRA's default. Lower it where a highlight was only just above the clip or for sparks such as fireworks.
clip_fillBOOLEANtrueFill clipped highlights: partial channels from the ones that survived, a smooth fill and dome for a blown sky, a peak and falloff for lamps and the sun. Off: the plain inverse.
highlight_detailFLOAT1.001–4Amplifies the structure that survives just under white (SDR luma 0.86-0.94 up): a sky, a window, an open door. 1 is off; 1.5-2 is the range to judge. Needs clip_fill.
exposure_evFLOAT0.00-3–3Moves the whole master brighter or darker, in stops (part of the grade, applied last).
output_encodingCOMBOLinear (Rec.709)Linear: scene-linear, 1.0 = reference_white_nits (diffuse white). ACEScg / AP0: the same in ACES primaries (a grading master). PQ / HLG: BT.2100 delivery code values.
clip_peaksoptSTRINGSet the peak of a clipped region: JSON, [{"x": 0.5, "y": 0.3, "nits": 2500}], x and y across the frame 0..1 (a point within 4 px of the region picks it). Empty: none.
anchoroptBOOLEANtrueAnchor to source exposure: mid-tones stay where the SDR had them (read through the source curve); the reconstruction takes over above anchor_knee.
anchor_kneeoptFLOAT0.900.5–0.98SDR code where the anchor lets go.
keep_source_colouroptBOOLEANtrueCarries the source's colour below the clip, so only clipped areas take the reconstruction's hue.
settle_grainoptBOOLEANtrueSettles flat near-white areas so grain lifted by the expansion does not shimmer.
peak_nitsoptFLOAT1000200–10000PQ / HLG only: mastering peak; brighter values roll off to it with the hue kept.
reference_white_nitsoptFLOAT203100–1000Linear 1.0 = this many nits (BT.2408: 203). Diffuse white lands on it.
regionoptRUDRA_REGIONFrom RUDRA Region: limit the reconstruction to a range of the SDR's brightness. Every pixel outside it keeps the plain inverse, bit for bit.
calibrationoptRUDRA_CALIBRATIONFrom RUDRA Calibrate: anchors (an SDR code and its nits) or a fit to a graded HDR reference, applied over the source curve.
maskoptMASKWhere the reconstruction may act (white). Outside it (black) the master is the plain inverse of the source curve, bit for bit. One mask for every frame, or one per frame.
source_primariesoptCOMBORec.709 / sRGBThe SDR's primaries. RUDRA makes the master in them and converts at the end, so a Display P3 photo keeps its colours. A connected `source` decides instead.
sourceoptRUDRA_SOURCEFrom ◎ Load Still (RUDRA): the still's own colour tag.

Outputs (6)

NameTypeDescription
imageIMAGEThe HDR master in output_encoding.
filled_maskMASK1 where the clip fill or the detail gain changed the pixel.
estimated_maskMASK1 where every channel clipped: the value is an extrapolation.
reportSTRINGWhat the conversion did, in words.
mattesRUDRA_MATTESRUDRA 1.1 mattes and pixel classes per frame, before the grade: for ◎ RUDRA Master Write.
regionsIMAGEThe pixel classes over the picture's grey: reconstructed cyan, estimated magenta, region edge white.