X2HDR LogC4 Decode
The newer ARRI curve with three more stops of highlight headroom
- image
- hdr_image
- metrics_json
If LogC3 is the safe classic, LogC4 is ARRI's newer curve - and the difference shows up at the top end. X2HDR LogC4 Decode inverts ARRI LogC4 per channel and reaches about 469.8 at encoded value 1.0, versus LogC3's 55.1. That's roughly three more stops of highlight headroom, which is exactly the point: LogC4 was designed so a single encoded range covers a wider dynamic range of real scenes. If your model or LoRA was trained with LogC4 targets, this is the node that turns VAE Decode output into scene-linear HDR.
Mechanically it's a pure transfer-function inverse, with one detail worth knowing: ARRI defines the inverse branch at code value 0, and this implementation keeps the curve continuous there. Like the LogC3 node, there's no peak scaling, no percentile normalization, and no AWG4 gamut matrix - you get the source primaries back unchanged, so leave room for a color-space conversion downstream if your target gamut differs.
Inputs
- image (
IMAGE) - usually straight fromVAE Decode. - input_range -
0_1(default) orminus1_1. Only chooseminus1_1for a tensor centered on [-1, 1]. - clamp_logc - default true; clamps encoded LogC values to [0, 1] before decoding.
Outputs
- hdr_image (
IMAGE, float32) - linear HDR. Values well above 1.0 are expected - remember, a correctly LogC4-decoded frame can have energy near ~470 at the top. Wire it intoX2HDR Save EXR,X2HDR Color Grade,X2HDR Tone Map Preview, orX2HDR Dynamic Range QA. - metrics_json (
STRING) - decode statistics.
Installing it
Same pack as the other X2HDR nodes: ComfyUI Manager → search comfyui-x2hdr → install, restart, nodes under image/HDR/X2HDR. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/facok/comfyui-x2hdr
then restart. The one extra dependency is PyAV (av), imported at load time; pip install av in ComfyUI's Python environment if the pack errors.
Where people get burned
- Matching is everything. Same trap as LogC3: a LogC4 decode of a LogC3-trained model gives a plausible preview and wrong scene-linear values. If you're unsure which curve a model was trained on, don't trust your eyes - compare the decode metrics and run
X2HDR Dynamic Range QA. - The huge float range is not a bug. A LogC4 decode reaching ~470 nits at the top looks terrifying in a raw tensor. Tone-map before judging; that's what the preview and grade nodes are for.
- Both LogC nodes share an interface, so the entire LogC3-vs-LogC4 decision is which encoding the training targets used. When in doubt, check the pack README's framing: a mismatched decoder "can produce plausible previews while returning incorrect scene-linear values."
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| input_range | COMBO | 0_1 | 2 options: 0_1, minus1_1 |
| clamp_logc | BOOLEAN | true | Clamp encoded LogC values to [0, 1] before decoding. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| hdr_image | IMAGE | — |
| metrics_json | STRING | — |