HDR Auto Log Select
Let the histogram pick your camera log
- image
- log_format
- compression_ratio
- stops_detected
- model_preset_used
Camera log formats are one of those things you either know cold or copy from someone else's workflow. ARRI LogC4, Sony S-Log3, Panasonic V-Log, Canon C-Log3, RED Log3G10, ACEScct - every one has a different highlight headroom, and picking the wrong one either wastes range or clips highlights you paid to reconstruct. HDR Auto Log Select measures the image and picks for you.
It's a small node with a narrow job, and it's genuinely the difference between a workflow that scales and one you tune by hand every shot. Wire it after your HDR step, before whatever node consumes a compression ratio.
What it actually does
It computes luminance across the batch, takes the 95th-percentile luma as a stand-in for the scene's peak highlight, and converts that into stops above 18% grey:
stops_needed = log2(peak95 / 0.18)
Then it walks a table of knee points and picks the smallest format that still fits - the one whose shoulder starts at or above stops_needed. The table is the real content of the node:
| Format | Knee (stops above 18% grey) | Default compression_ratio | |---|---|---| | LogC4 | 14 | 0.60 | | SLog3 | 15 | 0.65 | | LogC3 | 13 | 0.55 | | VLog | 12 | 0.55 | | ACEScct | 10 | 0.45 |
If nothing fits, it falls back to the widest (LogC4). The compression_ratio it emits is a pre-tested value chosen to pair with that format, so you get a working pair of numbers out of one node instead of looking both up.
Inputs and outputs
image is the required input, and it wants scene-linear data where 18% grey is 0.18 - the tooltip says so plainly. The image itself is never modified; this node only reports.
override defaults to auto. The five alternatives (LogC4, SLog3, VLog, LogC3, ACEScct) force that format, and stops_detected still gets measured, so you can compare your judgement against the node's on the same shot.
The optional model_hint is the clever bit: type a model name - flux, cogvideox, wan2.1, sdxl - and the compression_ratio output comes from the pack's RADIANCE_MODEL_PRESETS table instead of the log-format default. Different architectures have different VAE tolerance for wide input ranges, so a model-tuned ratio beats a generic one.
Four outputs: log_format (STRING), compression_ratio (FLOAT), stops_detected (FLOAT), model_preset_used (STRING). In practice compression_ratio is the wire you care about - it goes to the encoder/diagnostics side of the graph. log_format is a label you can show next to the report so you know what was chosen.
Install
Manager → search Radiance → Install → restart ComfyUI → 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: use ComfyUI's bundled python_embeded\python.exe for the pip install. Nothing here downloads a model.
Where people get burned
Check model_preset_used after a run. If you typed wan2.5 and the table doesn't know that key, the node falls back to the log-format default - model_preset_used comes back empty, which is how you know your hint did nothing. It won't shout at you.
Second, this node measures percentiles over the whole batch. On a long clip that's a union measurement, so a single blown frame raises the requirement for every frame. Good for consistency, bad if one rogue frame sets your format. And it's a measurement, not a transform: if log_format says SLog3 and nothing downstream actually applies an S-Log3 encode, you've just got a label.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Scene-linear HDR image (18% grey = 0.18). Its 95th-percentile luma sets how many stops above grey the log format must hold. The image itself is not changed. | |
| override | COMBO | auto | auto = choose the log format with the smallest highlight range that still fits the image. Any other choice forces that format; stops_detected is still measured. |
| model_hintopt | STRING | Optional model name (e.g. 'flux', 'cogvideox', 'wan2.1', 'sdxl'). When set, the compression_ratio output is taken from the RADIANCE_MODEL_PRESETS table instead of the log-format default. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| log_format | STRING | — |
| compression_ratio | FLOAT | — |
| stops_detected | FLOAT | — |
| model_preset_used | STRING | — |