Nodes/ComfyUI Layer Style/LayerColor: Levels
ComfyUI Node Runs on cloud

LayerColor: Levels

Levels — Photoshop Levels, per channel, in ComfyUI

By chflame163·Created 3 years ago·Updated 4 days ago· 3,113
LayerColor: Levels
  • image
  • image
◄channel▾►
â—„black_point0â–º
â—„white_point255â–º
â—„gray_point1.00â–º
â—„output_black_point0â–º
â—„output_white_point255â–º

If you've ever used the Levels dialog in Photoshop, you already know this node. It remaps the tonal range of an image: set where black starts, where white ends, adjust the midtone gamma in between, and optionally squeeze the output range. It's the precise, non-destructive-feeling way to fix contrast and color casts - the tool you use when BrightnessContrast is too blunt.

The real power is doing it per channel. Run it on red, green, or blue individually and you can pull a color cast out of an image directly - lift the blue channel's black point to warm up shadows, that kind of thing. On RGB it's a straight contrast/tone adjustment.

How it works

Levels is a two-stage remap. The input black/white points say "treat this input value as pure black, this one as pure white," stretching everything between them across the full range - that's what adds contrast and sets the clipping. The gray point is gamma: it slides the midtones brighter or darker without moving the endpoints. Then the output black/white points let you compress the result into a narrower band, which is how you get faded, matte, or "film black isn't quite black" looks.

The inputs and outputs that matter

  • channel - RGB (all together) or red / green / blue (one at a time, for color correction). This is what makes the node more than a contrast slider.
  • black_point / white_point (0–255) - the input clip points. Raise black to deepen shadows, lower white to lift highlights. Pull them toward each other to add contrast.
  • gray_point (0.01–9.99, default 1) - gamma. Above 1 brightens midtones, below 1 darkens them, endpoints untouched.
  • output_black_point / output_white_point (0–255) - compress the final range. Raise output black + lower output white for a faded/matte look.

Output: one adjusted image.

How to install it

Part of the LayerStyle pack. Via ComfyUI Manager: search LayerStyle, install, restart. Or manually:

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

then restart. It's under 😺dzNodes → LayerColor. No model needed.

Common issues & troubleshooting

Detail disappears in the shadows or highlights. You've clipped too hard - the input black/white points crush everything past them to solid black or white, and that data is gone. Back the points off, or use the output points to protect the ends.

Color cast won't budge on RGB. Switch channel and correct the offending channel directly. A blue cast comes out by working the blue channel, not the combined RGB.

Image looks flat / low-contrast on purpose isn't working. That's the output points - raise output_black_point and lower output_white_point to compress into a matte range. Leave them at 0/255 for full contrast.

Node missing from the menu. The LayerStyle pack didn't import - usually a broken transformers dependency (a stray TensorFlow is the frequent cause) crashing the whole pack on load. Read the traceback, "Try Fix" in Manager, or repair the library.

Category😺dzNodes/LayerColor

Inputs (7)

NameTypeDefaultDescription
imageIMAGE—
channelCOMBO4 options: RGB, red, green, blue
black_pointINT00–255—
white_pointINT2550–255—
gray_pointFLOAT1.000.01–9.99—
output_black_pointINT00–255—
output_white_pointINT2550–255—

Outputs (1)

NameTypeDescription
imageIMAGE—