ComfyUI Node

Nuke Levels

Fix washed-out contrast with proper black and white point controls

By sumitchatterjee13·Created about a year ago·Updated 9 days ago· 59
Nuke Levels
  • image
  • IMAGE
input_black0.00
input_white1.00
gamma1.00
output_black0.00
output_white1.00
mix1.00

The most common reason a generated image looks "off" isn't bad lighting in the render - it's a contrast curve that starts too high and ends too low. The blacks are actually dark gray, the whites are light gray, and the whole frame sits in a muddy middle band. NukeLevels fixes exactly that: you tell it where the real black point and white point are, and it stretches the image to fill the full range. It's the ComfyUI equivalent of the Levels control in every photo editor, with Nuke-style naming.

This is a first-aid grade node. Put it right after your image and before the save node, set input_black and input_white to bracket the actual dark and bright areas, and the flatness disappears. It's also the tool for the reverse move - crushing the range on purpose for a moodier, lower-contrast look.

How it works

It's a remap in three stages, all working on 0–1 values:

  1. Input levels - everything at or below input_black becomes 0, everything at or above input_white becomes 1, and everything between is stretched linearly across that range. This is your contrast fix.
  2. Gamma - a power curve applied afterward, so you can lift or crush the midtones without moving the black and white points again. Gamma above 1 brightens mids; below 1 darkens them.
  3. Output levels - output_black and output_white remap the result into a compressed or shifted output range, if you want the final image to intentionally not use the full range.

The alpha channel passes through untouched, and mix blends the result back toward the original so you can apply a percentage of the correction - handy when full contrast feels too aggressive.

The inputs that matter

  • input_black - where the darkest significant value in your image sits (0 to 1). Raise it to deepen blacks.
  • input_white - where the brightest significant value sits. Lower it to brighten the top end.
  • gamma - midtone curve, 0.1 to 3; 1 is neutral.
  • output_black / output_white - the destination range for the output. Default 0 and 1, i.e. full range.
  • mix - 0 to 1, how much of the correction to keep.

The output is a single IMAGE. Straight into a save node or on to the next grade.

Installing it

Part of the Nuke Nodes pack:

cd ComfyUI/custom_nodes
git clone https://github.com/sumitchatterjee13/nuke-nodes-comfyui.git nuke-nodes
cd nuke-nodes
pip install -r requirements.txt

Or search "Nuke Nodes" in ComfyUI Manager and restart. It's under the Nuke category, and like the other grade nodes it's pure PyTorch - nothing exotic to install for it to work.

Common issues

  • Image goes fully black - input_white is probably set below input_black, inverting the range. Keep black below white.
  • No visible change - mix at 0 neutralizes everything. Also, if the image already spans the full range, there's nothing to stretch - that's the "it's already fine" case.
  • Blacks crush too hard - that's expected when you raise input_black a lot; soften with mix or set input_black more conservatively.

If your images consistently come out washed out and flat, Levels is the fastest single-node fix in the pack.

CategoryNuke/Color

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
input_blackFLOAT0.000–1
input_whiteFLOAT1.000–1
gammaFLOAT1.000.1–3
output_blackFLOAT0.000–1
output_whiteFLOAT1.000–1
mixFLOAT1.000–1

Outputs (1)

NameTypeDescription
IMAGEIMAGE