ComfyUI Node

Gamma

The one color fix you can't mess up

By bvhari·Created 3 years ago·Updated about a year ago· 24
Gamma
  • images
  • IMAGE
gamma_value1.00

Flux renders wash out. SD models sometimes come out flat and milky. Before you reach for contrast sliders that crush your highlights, try gamma - it's the gentlest way to rescue a dull image, and the math behind it is so forgiving you almost can't break anything. This node wraps Kornia's adjust_gamma, and it's one of the handful of image corrections I'd call genuinely idiot-proof.

How it works

Gamma correction is a per-pixel power curve:

out = image ^ gamma

It's nonlinear on purpose. At gamma = 1 the image passes through untouched - that's your identity point. Push gamma below 1 and dark regions get lifted while highlights barely move, so shadows come alive without blowing out the sky. Push it above 1 and the image darkens overall, with shadows getting squashed first. Unlike an additive brightness shift, it preserves the relative detail in the highlights because it never adds a flat value - it reshapes the curve.

The inputs

  • images - a ComfyUI IMAGE, typically straight off VAE decode.
  • gamma_value (0–10, default 1) - this is the entire node. 1.0 does nothing; 0.8–0.95 lifts a washed-out image; 1.05–1.2 deepens one that's too pale.

Output is an IMAGE of the same size, ready to feed onward. That's the whole interface, and honestly it's all this needs.

Installing it

Part of the tiny ImageProcessing pack by bvhari - seven wrapper nodes around the Kornia library. Install it like any custom node:

cd ComfyUI/custom_nodes
git clone https://github.com/bvhari/ComfyUI_ImageProcessing
# restart ComfyUI - kornia installs automatically; no models to fetch

Or ComfyUI Manager → Custom Nodes Manager → search "ImageProcessing" → Install → restart. It shows up under the ImageProcessing category. No downloads, no keys, no GPU work - the node runs on CPU like the rest of the pack.

When it bites

Two traps, both easy to avoid. First: the widget's minimum is 0.0, and gamma = 0 means every pixel to the power of zero - which is 1. That's a solid white image. Stay in the 0.5–2 range and you'll never meet it, but now you know why the image went white. Second, it's global - no mask, no "brighten only the shadows" region. For selective fixes you'd want a region node or a different tool. And if kornia didn't install with the pack, you'll get an import error; pip install kornia into your ComfyUI environment fixes it. Everything else about this node is just "set a number, look at the result, nudge it."

CategoryImageProcessing

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
gamma_valueFLOAT1.000–10

Outputs (1)

NameTypeDescription
IMAGEIMAGE