Nodes/ComfyUI_ColorMod/Tonemap (Drago)
ComfyUI Node

Tonemap (Drago)

The one for recovering shadow detail

By city96·Created 3 years ago·Updated 2 years ago· 111
Tonemap (Drago)
  • image
  • IMAGE
gamma1.00
saturation1.00
bias1.00
mult1.00

Drago tonemapping is an adaptive logarithmic operator - instead of compressing the whole HDR range with one global curve like Reinhard, it maps logarithmically in a way that tends to hold onto shadow detail. If your HDR merge comes back too dark in the low end, Drago is often the node that rescues it. It's one of four tonemap variants in this pack, and its thing is dark-area recovery.

Like the rest of the family it wraps the matching OpenCV operator (createTonemapDrago) plus the pack's shared mult brightness multiplier. It's meant for HDR input - [0, 1] SDR images get "tonemapped" too, but that's usually pointless.

The inputs

  • gamma (default 1.0) - gamma correction applied to the output. Your main "brightness shape" knob.
  • saturation (default 1.0) - color saturation of the result. Below 1 desaturates, above 1 pushes color.
  • bias (default 1.0, range 0–1) - this is Drago's signature control: it biases the tone curve toward detail in bright or dark areas. Values approaching 0 push more detail into the shadows (useful when your dark passes are losing information); 1 is the standard balance. Expect to actually test this one - it has real range.
  • mult (default 1.0) - the pack's non-standard multiplier, applied to the tonemapped result. Try 2–3 for HDR input, per the README.
  • image in, one IMAGE out, already clipped to [0, 1] so it's safe to feed the VAE.

Installing

From the ColorMod pack, needs OpenCV:

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

Restart, or install via ComfyUI Manager ("ComfyUI_ColorMod"). Missing → opencv not installed (console prints "Can't find opencv!").

What to watch for

  • Drago can look flat. Its whole job is pulling detail out of the whole range, so the output can feel lower-contrast than Reinhard's. If that bothers you, run the result through a ColorMod node (like ColorMod (edges) or (move pivot)) to add contrast back.
  • The bias knob is where the node lives or dies. Leave it at 1 and Drago behaves; drop it and you're trading highlight character for shadow recovery. For generated HDR (where the "exposures" were guesses anyway), the README's advice stands: tonemapping is trial-and-error, so budget a few runs.
  • It behaves differently on SDR vs HDR. Keep it in the HDR pipeline where it belongs.

If you only ever tonemap one way, Reinhard is the safe default - but if your merged HDR keeps losing the dark end, Drago is the variant that actually solves that specific complaint.

CategoryColorMod/tonemap

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
gammaFLOAT1.000–8
saturationFLOAT1.000–8
biasFLOAT1.000–1
multFLOAT1.000–8

Outputs (1)

NameTypeDescription
IMAGEIMAGE