Nodes/radiance/HDR Diagnostics
ComfyUI Node

HDR Diagnostics

The node that tells you your compression ratio was too hot

By FXTD-Studios·Created 8 months ago·Updated about 18 hours ago· 246
HDR Diagnostics
  • image
  • coherence_map
  • report_json
  • psnr_estimate
  • peak_stops
  • peak_nit
  • ev_range
  • clipped_pct
  • is_hdr
◄compression_ratio0.50►
◄model_preset_used►
◄stats_json►
◄colorspaceLinear (sRGB)►

Every HDR workflow in this pack has a number in it that you're supposed to guess: compression_ratio. Set it too low and your highlights go flat and milky. Too high and the VAE starts producing banding. Until now the loop was "change the number, regenerate, squint at the preview, repeat." HDR Diagnostics breaks that loop. It measures the image before compression, estimates the round-trip PSNR that ratio will give you, and returns a JSON report you can actually diff.

It's the pair to HDR Auto Log Select: that node picks the compression ratio, this one tells you what it cost you. Their descriptions link directly - the model_preset_used string is meant to be wired straight from Auto Log Select into here.

How it works

The node computes histogram statistics and a peak-stops measurement on the HDR image before compression, then estimates PSNR for the round trip the encoder is about to perform. Metrics use the same BT.2408 anchor as the rest of the pack: linear 1.0 is 203 nits, so anything peaking above that is genuine HDR content.

Everything goes into one JSON blob, which distinguishes it from the older, thinner analysis node - that one returned floats and a stats string; this one returns a report built for logging and for CI assertions. The report is emitted to the radiance.diagnostics logger too, so with the right logging config you can redirect the whole thing to a file or a remote sink, which is how you'd regression-test a pipeline overnight.

Inputs and outputs

The only required input is image - the HDR data before compression.

The optional inputs are all about context, and two of them matter:

  • compression_ratio (default 0.5) - must match the value the encoder is actually using, or the PSNR estimate is fiction. This is the tooltip's own warning and it's the mistake people make.
  • stats_json - the JSON from HDR Per-Channel Norm, so you can see per-channel mean/std after normalisation.
  • model_preset_used, coherence_map (only its mean is reported, as coherence_mean), and colorspace (a short four-entry list: Linear (sRGB), ACEScg, sRGB, Rec.709).

Seven outputs: report_json, psnr_estimate, peak_stops, peak_nit, ev_range, clipped_pct, is_hdr. The four live metric floats are the same ones HDR Analysis exposes, which is why this node supersedes it - you get the report and the numbers you'd wire into conditional logic.

Install

Manager → search Radiance → Install → restart → refresh the browser.

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: use python_embeded\python.exe. No weights to download for this node.

Where people get burned

This is an output node. In ComfyUI that means it always executes when the graph runs, even if nothing downstream consumes it. Usually that's what you want - you're wiring it precisely so you can see the numbers. But it also means it can pull its whole input branch into execution, so if a diagnostic branch looks like it's making your queue slower, it is.

The second trap is the compression_ratio you pass in versus the one your encoder is set to, and it's worse than a stale number: because it's a plain widget rather than a wire, nothing stops the two from drifting apart as you tune. Wire the same compression_ratio source to both nodes if you're going to iterate seriously.

Third, coherence_map only contributes its mean to the report. Don't wire a mask in expecting per-region analysis; you'll get one number called coherence_mean and no spatial information.

CategoryFXTD STUDIOS/Radiance/HDR

Inputs (6)

NameTypeDefaultDescription
imageIMAGEHDR image before compression, encoded as set by colorspace. Metrics treat linear 1.0 as 203 nits.
compression_ratiooptFLOAT0.500–1Must match the value used in RadianceHDRTurboEncoder.
model_preset_usedoptSTRINGResolved model key from AutoLogSelect.
stats_jsonoptSTRINGJSON from RadianceHDRPerChannelNorm (optional).
coherence_mapoptIMAGEOptional coherence map (0 to 1). Only its mean is reported, as coherence_mean in the JSON.
colorspaceoptCOMBOLinear (sRGB)Input colour space for nit/EV-range estimation.

Outputs (7)

NameTypeDescription
report_jsonSTRING—
psnr_estimateFLOAT—
peak_stopsFLOAT—
peak_nitFLOAT—
ev_rangeFLOAT—
clipped_pctFLOAT—
is_hdrBOOLEAN—