ComfyUI Node

KorniaGamma

Brightness, contrast, levels — one knob each

By TeaCrab·Created 3 years ago·Updated 5 months ago· 5
KorniaGamma
  • image
  • IMAGE
gamma1.00
gain1.00

Every image tool has a brightness slider, and most are useless for anything past "slightly dim." KorniaGamma is the proper version: a gamma adjustment combined with a gain multiplier, applied in the tensor domain by kornia rather than through some lossy CPU round-trip. The author's README is characteristically honest about it - "works like an easy/complex/idk brightness/contrast/level adjustment node." It's easy, it's real, and it behaves.

It's one node in the small ComfyUI-TeaNodes pack by TeaCrab, MIT, in the TeaNodes/Image menu.

How it works

kornia.enhance.adjust_gamma(image, gamma, gain) applies out = gain * image^gamma across the pixels. The shape of that curve is what makes gamma more useful than a brightness slider:

  • gamma < 1 (default is 1 = no change) brightens - but it lifts midtones and shadows far more than highlights, which is the difference between "brighter" and "washed out."
  • gamma > 1 darkens while preserving contrast in the highlights.
  • gain then scales everything on top - effectively the global brightness, and it goes negative if you want to invert into strange territory.

Ranges are generous: gamma 0–100, gain −100 to 100, both with 0.01 steps. Because it runs on the tensor inside your graph, there's no quality loss and no extra round-trip - it slots anywhere an IMAGE flows.

The inputs that matter

  • image - your source.
  • gamma - the tone curve shape. This is the one you'll actually touch: below 1 brightens, above 1 darkens.
  • gain - overall brightness scale. Set it and forget it, or nudge it to compensate after a gamma change.

Output is the adjusted IMAGE.

When you'd reach for it

  • Levels on the fly. Fix a slightly dark render before it hits the save node or an upscaler.
  • Feeding preprocessors. Matching a ControlNet preprocessor's lighting expectation is often easier with a curve than a brightness slider.
  • Matching batches. A fixed gamma tweak keeps a photo series consistent before a loop, instead of eyeballing each frame.

The author's line about image processing power being "utilized for better results" is fair - the difference between this and a naive brightness node is exactly where the curve matters: shadows lift without the highlights blowing out.

Installing it

ComfyUI Manager → search ComfyUI-TeaNodes, or:

cd ComfyUI/custom_nodes
git clone https://github.com/TeaCrab/ComfyUI-TeaNodes

restart ComfyUI. kornia is already a ComfyUI core dependency, so this node needs nothing extra - the pack's own requirements file only declares the author's regex_spm helper. No model files anywhere.

If you've been stacking Brightness + Contrast nodes to fake a tone curve, this is the cleaner replacement. One gamma, one gain, and a curve that actually behaves like a curve.

CategoryTeaNodes/Image

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
gammaFLOAT1.000–100
gainFLOAT1.00-100–100

Outputs (1)

NameTypeDescription
IMAGEIMAGE