ComfyUI Node

Levels

Black point, white point, gamma — the real contrast tool

By chrisfreilich·Created 2 years ago·Updated about a year ago· 93
Levels
  • image
  • IMAGE
channel
input_black_point0.00
input_gamma1.00
input_white_point1.00
output_black_point0.00
output_white_point1.00

If your output looks washed out and flat, or blown-out and crushed, Levels is the tool that actually fixes that - not a saturation slider, not a contrast slider, but direct control over where black starts, where white ends, and the gamma curve in between. It's a straight port of Photoshop's Levels adjustment layer, and it's the node to reach for whenever the fix you want is "this image needs more punch" or "this needs to look less contrasty."

How it works

You set two pairs of points. On the input side, input_black_point and input_white_point define which brightness values get remapped to pure black and pure white - everything outside that range clips. input_gamma bends the midpoint of that mapping up or down without touching the black/white points, which is how you brighten or darken midtones without affecting your black and white clipping. On the output side, output_black_point and output_white_point do the reverse: instead of what maps to black and white, they set how dark black actually goes and how bright white actually goes in the final result - useful for deliberately flattening contrast (raising the output black point) rather than maximizing it.

The inputs and outputs that matter

  • image - the image to adjust.
  • channel - RGB to affect the whole image at once, or red/green/blue to work on a single channel (handy for correcting a color cast that's specific to one channel rather than the whole image).
  • input_black_point (0–0.98, default 0) - brightness level that becomes pure black.
  • input_gamma (0.01–9.99, default 1) - midtone curve. Above 1 brightens midtones, below 1 darkens them.
  • input_white_point (0–1, default 1) - brightness level that becomes pure white.
  • output_black_point / output_white_point (0–1, default 0 / 1) - where black and white actually land in the output; move these inward to compress and flatten contrast rather than expand it.

Output is a single IMAGE.

How to install it

ComfyUI Manager: search Virtuoso Nodes for ComfyUI, install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/chrisfreilich/virtuoso-nodes
pip install -r virtuoso-nodes/requirements.txt

Restart and find it under Virtuoso/Adjustment. No model files, cheap to run.

Common issues & troubleshooting

Nudged the input points and nothing visibly changed. input_black_point maxes out at 0.98, not 1.0 - by design, so you can't accidentally clip the entire image to black. If you want a stronger contrast push, pair it with lowering input_white_point from the other end rather than pushing input_black_point further, since it's capped.

Colors shift when you only meant to fix contrast. Make sure channel is set to RGB. If it's left on red, green, or blue from a previous tweak, you're only correcting one channel and introducing a color cast rather than an overall contrast change - an easy setting to forget you changed.

Trying to fix a specific color cast (image too orange, too green, etc.). Levels can help per-channel, but for a more surgical color-only fix without touching contrast, Color Balance or Color Balance Advanced are the better-suited tools - Levels is fundamentally a brightness/contrast tool first.

CategoryVirtuoso/Adjustment

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
channelCOMBO4 options: RGB, red, green, blue
input_black_pointFLOAT0.000–0.98
input_gammaFLOAT1.000.01–9.99
input_white_pointFLOAT1.000–1
output_black_pointFLOAT0.000–1
output_white_pointFLOAT1.000–1

Outputs (1)

NameTypeDescription
IMAGEIMAGE