Levels Adjustment
Photoshop Levels for your texture maps, minus the subscription
- image
- result
If you've ever opened the Levels dialog in Photoshop, you know exactly what this node does before reading another word: set where black starts, where white starts, bend the gamma in between, then decide where the output range lands. It's one of those fundamental color tools that people assume ComfyUI has built in - and mostly you have to hunt for it. TextureAlchemy ships one in its Texture Alchemist/Color category, and for a PBR workflow it earns its keep constantly: fixing washed-out albedos, re-spreading the range of a compressed height map, or adding contrast to a roughness map that came out of an AI extractor looking like a gray smear.
The pack's own summary calls it an "essential tool," and for once the marketing isn't overselling. It's the control you reach for when a brightness slider is too blunt and a curve is too fiddly.
How it works
It's a two-stage remap. First the input range: input_black and input_white define the tonal window of the source image, with input_gamma bending the curve between them (gamma < 1 lifts midtones, > 1 darkens them). Then the output range: output_black and output_white map that stretched result onto the final 0–1 space. Clamp at the end keeps everything legal.
What makes it texture-grade rather than toy-grade is the mode selector, which lets you target which channels get the treatment:
- rgb - the whole image.
- red / green / blue - one channel only, leaving the others untouched. This is how you fix a color cast or push a specific channel in a packed texture.
- luminosity - computes luminance, adjusts it, and scales the RGB channels by the ratio. Contrast and exposure fixes without hue drift - usually the right mode for albedo work.
The single output is result, same size as the input. Drop it inline anywhere in a texture chain.
The inputs that matter
- input_black / input_white - pull
input_blackup to crush shadows and increase contrast; pullinput_whitedown to brighten the highlights. - input_gamma - the midtone dial, and the one you'll nudge most often to bring a flat map back to life.
- mode -
luminosityfor albedo,rgbfor maps you just want brighter, the channel modes for targeted fixes.
Installing it
Part of ComfyUI-TextureAlchemy - one install gets you the whole pack. ComfyUI Manager → search "TextureAlchemy" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy
Restart and look under Texture Alchemist → Color. No pip requirements, no model downloads - pure tensor math on torch.
Common issues
- "Everything got way too dark." You've almost certainly raised
input_blacktoo far. Remember it's a black point, not a brightness knob - small movements, check the result. - "Gamma does nothing." At
input_gamma = 1it's a no-op by design. Move it to 1.2 or 0.8 and you'll see it bend midtones. - "Color shifted weirdly." If you're on
rgbmode, the channels move together but the perception of color can still shift. Switch toluminosityif you want brightness-only control. - Saving makes it band. Levels stretches values, which exposes quantization - that's not this node failing, that's 8-bit PNG being 8-bit. Save heavy adjustments as EXR if precision matters.
It's the unglamorous workhorse of the pack. Learn it, because it's the tool that makes every other map look like it wasn't extracted by a neural net having a bad day.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| input_black | FLOAT | 0.000–1 | — |
| input_white | FLOAT | 1.000–1 | — |
| input_gamma | FLOAT | 1.000.1–3 | — |
| output_black | FLOAT | 0.000–1 | — |
| output_white | FLOAT | 1.000–1 | — |
| mode | COMBO | 5 options: rgb, red, green, blue, luminosity |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | IMAGE | — |