Nodes/ComfyUI_Gear/Gear · ACEScct Encode
ComfyUI Node

Gear · ACEScct Encode

The forward curve — shove real HDR into an ACEScct pipeline without clipping the highlights

By oumad·Created 4 months ago·Updated 4 days ago· 0
Gear · ACEScct Encode
  • image
  • image
input_space
exposure_ev0.00

Gear · ACEScct Encode is the mirror image of the ACEScct decode node. Where the decoder takes a [0,1] ACEScct image and unflattens it into scene-linear HDR, this one runs the forward curve: it takes genuine linear HDR and compresses it into ACEScct [0,1] so you can feed real HDR content into a pipeline that expects ACEScct-encoded input. That matters for HDR-to-HDR conditioning of the ACEScct Prodigy r128 LoRAs, and more generally for getting EXR plates into any [0,1] model without collapsing the range first.

The classic setup is one hop long: Gear · Load EXR → Gear · ACEScct Encode → your [0,1] pipeline. You load a linear EXR (values well past 1.0 intact), compress it into code space, and hand it to the model.

The input that matters

The node has three inputs, but input_space is the one that decides whether this works or silently mangles your image:

  • linear_acescg - the image is already ACEScg/AP1 scene-linear. The node just applies the curve. This is the canonical case, and the pass-through option.
  • linear_rec709 - the image is scene-linear with Rec.709/sRGB primaries (Blender and Poly Haven renders default here). The node runs a 709→AP1 matrix, then the curve.
  • srgb_display - the image is display-referred sRGB [0,1], i.e. an ordinary PNG/JPG. The node applies the sRGB EOTF to un-display it, then the matrix, then the curve.

exposure_ev is a pre-encode EV shift (linear * 2^ev) applied before the curve - handy for matching a plate to the LoRA's training exposure. image is the HDR input, and values above 1.0 are expected for the linear options.

Output

A single image in ACEScct [0,1]. Anything above ~222.86 linear clips at code 1.0 - the curve's ceiling, same as the decoder's. The mechanism is a hand-rolled aces_mats.py (Rec.709↔AP1 matrices plus sRGB EOTF) feeding acescct.compress(), all torch, no OCIO dependency anywhere.

Where people get burned

Picking the wrong input_space. Feed a plain sRGB PNG in as linear_acescg and you'll apply the curve to display-referred values - everything over-darkens and the toe crushes. Feed linear HDR in as srgb_display and the EOTF double-applies, pushing values up into the clip. The fix is boring and reliable: think about where the image came from, not what it looks like. Blender plate → linear_rec709. EXR exported from an ACES pipeline → linear_acescg. Screenshot/PNG → srgb_display.

Install via ComfyUI Manager (search ComfyUI_Gear) or:

cd ComfyUI/custom_nodes
git clone https://github.com/oumad/ComfyUI_Gear
cd ComfyUI_Gear
pip install -r requirements.txt

Then restart. Deps are opencv-python, numpy, Pillow - nothing heavy, no models to download. It's a small, boring, correct node, and that's exactly what you want on the way into a conditioning pipeline.

CategoryGear/HDR

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
input_spaceCOMBO3 options: linear_acescg, linear_rec709, srgb_display
exposure_evFLOAT0.00-8–8

Outputs (1)

NameTypeDescription
imageIMAGE