πΎ Auto Levels
The one-click fix for washed-out generations
- image
- IMAGE
You know the look. The model nails the composition, and then hands you an image that's gray, flat, and looks like it was printed on recycled paper. Auto Levels is the "make it pop" button for that moment - a one-click histogram correction that stretches the tonal range back out without you touching a single slider. If you've ever felt a pang of nostalgia for your phone's auto-enhance, this is that, minus the "more saturated than reality" nonsense.
What it actually does
Under the hood it's the classic auto-levels algorithm: analyze the image's histogram, find where the darkest and brightest pixels actually live, then remap so that the dark end goes to pure black and the bright end to pure white. The gap between generation output and "proper" contrast is usually a matter of the model compressing everything into the middle of the range - Auto Levels just undoes that squeeze.
The two knobs that matter
- clip_percent (default 0.1) - how much of the extreme highlights and shadows to ignore when finding the black/white points. A little clipping keeps a few blown-out specular highlights or noise specks from throwing off the whole stretch. Crank it up when the image has sensor-style noise or film grain that's living in the tails.
- strength (default 1.0) - blends the corrected result back with the original. Dial it to 0.5 if full auto looks too crunchy and you want a gentler lift.
That's it. Feed it an image and it returns a corrected IMAGE you can wire straight into a Save or Preview node. It's not a deep node and it doesn't pretend to be - no mask support, no channel control. If you need those, the same pack's Curves Adjust Pro or Levels Adjust are the better fits. Auto Levels earns its keep as the quick-and-dirty first pass, or as a batch-friendly no-brainer when you're churning out a bunch of renders and want consistent contrast without babysitting.
Install
This is part of the MachinePainting Nodes pack (40 nodes of image editing and utility stuff), so you get it with the whole package:
cd ComfyUI/custom_nodes
git clone https://github.com/machinepainting/ComfyUI-MachinePaintingNodes.git
pip install -r requirements.txt
Or, easier: open ComfyUI Manager, search "MachinePaintingNodes", and hit Install. Restart ComfyUI afterwards either way.
One heads-up if you install manually: the pack's requirements.txt pulls in opencv-python-headless, numpy (pinned below 3) and rembg - rembg only actually matters for Remove Background Pro, but pip will grab it (plus its onnxruntime dependency) regardless. It's a chunky install for a one-slider node, but you'll have the whole toolkit afterwards.
Common issues
The main gotcha is over-clipping: if clip_percent is too high and the image has real blown highlights, Auto Levels will happily declare them pure white and you'll lose detail you wanted. If the output looks harsh, drop strength before you fight the clip_percent. And if your image already has a strong grade on it, this node will stomp it - it's a neutralizer, not a finishing touch. Use it early in the chain, then grade on top.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| clip_percentopt | FLOAT | 0.10β5 | β |
| strengthopt | FLOAT | 1.000β1 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |