Nodes/radiance/RUDRA Calibrate
ComfyUI Node

RUDRA Calibrate

Your SDR curve assumption is wrong — fix it with a grey card, or steal the answer from a graded HDR

By FXTD-Studios·Created 11 months ago·Updated 9 days ago· 264
RUDRA Calibrate
  • image
  • reference
  • calibration
  • summary
◄anchors►
◄frame0►
◄reference_white_nits203►

Why you'd want this

SDR → HDR Analytic assumes your source was made with one of seven curves and that the curve is applied cleanly. Most of the time that's true enough. But real footage lies: a phone shot in Display P3 and then re-tagged, a clip that went through someone's LUT, a still whose "white" is at code 244 because the photographer exposed for the sky. In those cases the analytic node is reversing approximately the right curve with the wrong scaling, and you get a master that's uniformly a bit dark or a bit milky.

RUDRA Calibrate is the correction. It doesn't touch pixels - it emits a RUDRA_CALIBRATION object that the analytic node applies over its source curve. Two routes into it: three anchor points you specify, or a reference HDR you already trust.

Anchors are the professional habit: you know an 18% grey card is 30 nits in the target, so tell the node where that grey sits in your SDR and what it should become. Reference is the lazy route with better results if you have one: hand it a graded HDR of the same frame and it fits the curve to it by least squares.

How it works

Anchors are JSON strings in the anchors box, up to three of them, in either of two flavours:

[{"code": 118, "nits": 30}]
[{"x": 0.4, "y": 0.6, "nits": 2.5}, {"x": 0.8, "y": 0.2, "nits": 400}]

A code is an SDR code value; a position is 0..1 across the frame and its code is the SDR luma there, which is how you anchor to something you can see - a grey card, a wall, a lamp - instead of eyeballing numbers. One anchor shifts exposure. Two or three bend the curve through the points, which is how you fix contrast as well as level.

For the reference route you wire a graded HDR into reference, and reference_white_nits tells it what 1.0 means in that reference (203 by default, BT.2408). It samples the pair and fits. When a reference is connected, the anchors are ignored - silently, which is per the tooltip but still worth knowing.

The summary output is the useful part: with anchors it lists the points; with a reference it reports samples, how many codes were seen, and residual mean and p95 in stops. If that p95 comes back over half a stop, the summary says so - and that's real, it means the grade has a local key the curve physically can't carry. Don't fight it, go fix that shot by hand.

frame picks which frame of the batch the positions and the fit read. Positions and reference both need image connected, so the node sees the SDR it's calibrating.

Inputs and outputs

Required: image (the SDR the analytic node will convert), anchors (the JSON string), frame. Optional: reference (a graded HDR, same size as the SDR) and reference_white_nits.

Out: calibration → analytic node's calibration input, and summary (a STRING you can preview or just read in the console).

Install

One pack, one install:

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

Or ComfyUI Manager → search Radiance → Install, then restart and refresh the browser. Windows portable: use python_embeded\python.exe for the pip step. Nothing extra to download for this node.

Where people get burned

Malformed JSON is the one that gets everyone. The anchors box is parsed as JSON, not as text - {code: 118, nits: 30} without quotes is not JSON, and a trailing comma kills it. Watch the console for the error rather than assuming the node did nothing.

Second, and this is the design decision people trip over: calibration corrects the source curve, it is not a grade. If you push anchors hard to hit a look, you're telling the node your SDR was made wrong, and the clip fill downstream will behave accordingly. For a look, use the analytic node's own exposure_ev, or HDR Region EV after the master.

Third: if you calibrate a still, do it on one frame (set frame) and check summary before rendering a whole clip. A fit that's clean on frame 0 can be well off on frame 200 if the exposure changed.

CategoryFXTD STUDIOS/Radiance/HDR

Inputs (5)

NameTypeDefaultDescription
imageIMAGEThe SDR frames SDR → HDR Analytic converts (for positions and the reference fit).
anchorsSTRINGJSON, up to three: [{"code": 118, "nits": 30}] by SDR code, or [{"x": 0.4, "y": 0.6, "nits": 2.5}] by position (0..1 across the frame; its code is the SDR luma there). Ignored when a reference is connected.
frameINT00–100000The frame of the batch the positions and the reference fit read.
referenceoptIMAGEA graded HDR of the same frame: scene-linear Rec.709, 1.0 = reference_white_nits, the SDR's size. Replaces the anchors.
reference_white_nitsoptFLOAT203100–1000What 1.0 means in the reference.

Outputs (2)

NameTypeDescription
calibrationRUDRA_CALIBRATION—
summarySTRING—