Levels Adjustment
The Levels panel you thought you'd left behind in Photoshop
- image
- IMAGE
When an image is washed out or the blacks are muddy, contrast sliders make you guess. Levels makes you set the endpoints: here's where black is, here's where white is, here's the gamma between them. This node is a straight port of the Photoshop Levels panel - in_black, in_white, out_black, out_white, and gamma - and it's the node I'd reach for over the pack's simpler Contrast Brightness when an image needs its tonal range actually remapped rather than just multiplied.
How it works
You define a mapping from input levels to output levels. in_black and in_white (0–255) declare the darkest and brightest values that exist in your source; anything below in_black maps to out_black, anything above in_white maps to out_white, and everything between stretches across the output range. gamma then bends the curve in the middle - below 1 lifts midtones, above 1 darkens them, leaving your black/white points pinned.
The practical win: an image with shadows that only reach 30/255 gets its blacks pushed down to 0 just by setting in_black to 30. That's the "expand the tonal range" move that instantly fixes the flat look, and it's deterministic - the same settings on a batch produce identical grading, which is the whole point of this pack.
Inputs that matter
- in_black / in_white - where your source's tonal range actually starts and ends. The two you'll set most
- out_black / out_white - where you want it to land. Default 0–255 (full range); narrow them for a faded, lifted-black film look
- gamma - the midtone bend, 0–2, default 1.0. The subtle lever for contrast-in-the-middles without touching endpoints
One IMAGE in, one IMAGE out.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/TrophiHunter/ComfyUI_Photography_Nodes
Restart, then TrophiHunter/Photography in the node menu (ComfyUI Manager: "Photography Nodes"). No dependencies beyond the pack's built-in torch/PIL.
Where people get burned
The classic inversion mistake: setting in_black below the actual dark content does nothing (there's nothing to remap), so people "fix" flat images by dragging the wrong endpoint. Read it as "where does my data start," not "how black do I want it." Also, in_black and in_white must bracket your data - if you set in_white below actual highlights, you'll clip them hard and there's no undo within the node (that's what out_white is for). In the author's example chain, Levels comes right after Contrast Brightness and before Saturation - flatten/range first, then grade on top. That ordering is the whole trick to making the pack's effects stack like a camera pipeline.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| in_black | INT | 00–255 | — |
| in_white | INT | 2550–255 | — |
| out_black | INT | 00–255 | — |
| out_white | INT | 2550–255 | — |
| gamma | FLOAT | 1.0000–2 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |