Nodes/MachinePainting Nodes/πŸ‘Ύ Levels Adjust
ComfyUI Node

πŸ‘Ύ Levels Adjust

The full Photoshop levels panel, channel-aware and slider-driven

By machinepaintingΒ·Created 10 months agoΒ·Updated 4 months agoΒ· 9
πŸ‘Ύ Levels Adjust
  • image
  • IMAGE
β—„black_point0.00β–Ί
β—„white_point1.00β–Ί
β—„gamma1.00β–Ί
β—„output_black0.00β–Ί
β—„output_white1.00β–Ί

Every image editor has a Levels panel, and they all do the same five things: set the black point, set the white point, bend the midtones with gamma, and optionally remap the output range. Levels Adjust is that panel for ComfyUI - no histograms to read, no curves to drag, just five sliders that fix the most common exposure problems on generated images. If Auto Levels is the automatic version, this is the manual one, and they're the perfect first-vs-final grade pair.

The five sliders

  • black_point (0–0.5, default 0) - everything at or below this input value becomes pure black. Move it up to kill milky, lifted shadows.
  • white_point (0.5–1, default 1) - everything at or above becomes pure white. Move it down to reclaim blown highlights.
  • gamma (0.1–3, default 1) - the midtone bend. Below 1 darkens midtones, above 1 brightens them, without touching your black/white points. This is the slider that makes a flat render "pop" without nuking either end.
  • output_black (0–0.5) and output_white (0.5–1) - the "output" side of levels: remap where the corrected range lands. Output black above 0 lifts the whole shadow floor (the vintage-fade trick); output white below 1 pulls the ceiling down.

That's the complete Photoshop input/output-levels model, applied on the image's pixel values - nothing exotic, just the exact math you'd expect ((v βˆ’ black)/(white βˆ’ black), gamma curve, then output remap), clipped to 0–1.

When to use it vs. the alternatives

  • Needs fixing automatically β†’ Auto Levels (clip_percent + strength).
  • Wants a gentle global lift β†’ this node, black_point β‰ˆ 0.02–0.05, white_point β‰ˆ 0.95–0.98, gamma nudge.
  • Wants per-channel or shaped control β†’ Curves Adjust Pro in the same pack, which shares this family of math and adds the RGB channels.

Levels is the "engineer's" choice: deterministic, one number per problem, easy to replicate across a batch. Curve it once for an expressive look; use Levels when you want the same predictable correction on every frame.

Install

It's in MachinePainting Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/machinepainting/ComfyUI-MachinePaintingNodes.git
pip install -r requirements.txt

or ComfyUI Manager β†’ "MachinePaintingNodes" β†’ install β†’ restart.

Gotchas

The sliders are constrained so black_point can't cross white_point (max 0.5, min 0.5 respectively), but you can still produce a reversed feel by setting output levels awkwardly - output_black above output_white will invert your tonal range into a negative-ish look. If your image comes out "weird," check you haven't inverted the output pair. Also, levels is a global pass: no mask, no per-channel control, so selective correction lives in Curves Adjust Pro or the zone sliders of Color Adjust Blend. And unlike Auto Levels there's no strength blend - it's all-or-nothing per slider, which is fine because each slider is small enough to tune precisely.

CategoryMachinePaintingNodes/Color

Inputs (6)

NameTypeDefaultDescription
imageIMAGEβ€”
black_pointoptFLOAT0.000–0.5β€”
white_pointoptFLOAT1.000.5–1β€”
gammaoptFLOAT1.000.1–3β€”
output_blackoptFLOAT0.000–0.5β€”
output_whiteoptFLOAT1.000.5–1β€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”