Nuke Levels
Fix washed-out contrast with proper black and white point controls
- image
- IMAGE
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:
- Input levels - everything at or below
input_blackbecomes 0, everything at or aboveinput_whitebecomes 1, and everything between is stretched linearly across that range. This is your contrast fix. - 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.
- Output levels -
output_blackandoutput_whiteremap 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_whiteis probably set belowinput_black, inverting the range. Keep black below white. - No visible change -
mixat 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_blacka lot; soften withmixor setinput_blackmore conservatively.
If your images consistently come out washed out and flat, Levels is the fastest single-node fix in the pack.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| input_black | FLOAT | 0.000–1 | — |
| input_white | FLOAT | 1.000–1 | — |
| gamma | FLOAT | 1.000.1–3 | — |
| output_black | FLOAT | 0.000–1 | — |
| output_white | FLOAT | 1.000–1 | — |
| mix | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |