Image Shadows and Highlights
Lift shadows, tame highlights in ComfyUI
- image
- image
- shadow_map
- highlight_map
If you've ever opened a render in Lightroom or Photoshop and pulled the Shadows slider up to rescue detail in the dark areas without blowing out the bright ones, you already know what this node is for. Image Shadows and Highlights does that tonal adjustment inside your ComfyUI graph - brighten the shadows, pull back the highlights, all without touching the midtones the way a flat brightness change would.
This is one of the many post-processing utilities that make WAS Node Suite worth keeping around: the little photographic finishing moves that core ComfyUI just doesn't ship. Generated images often come out with crushed shadows or clipped highlights, and this is the targeted fix.
How it works
A plain brightness control shifts every pixel by the same amount - lift the shadows and you wash out the whole image. This node is smarter: it works on tonal ranges. It identifies the darker pixels and the brighter pixels separately and lets you push each independently, with a smooth falloff so the correction blends into the midtones instead of leaving a hard edge. That's the difference between "recovering shadow detail" and "making the picture gray."
You give it an image, set how much to lift the shadows and how much to rein in the highlights (usually with a radius/softness control governing how gently the effect blends), and it hands back the adjusted image.
The inputs and outputs that matter
The core input is your image, and the two adjustments that matter are the shadow amount and the highlight amount - how hard to push each end of the tonal range. There's typically a radius/softness control too, which decides how smoothly the correction feathers into the midtones; leave it near default unless you see banding. The main output is the corrected image to wire into your save or next filter.
Start gentle. Small moves on shadows and highlights read as "nicely finished"; big moves read as "obviously processed."
How to install it
Bundled in WAS Node Suite. Install the pack once through ComfyUI Manager - search WAS Node Suite, install, restart - or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
pip install -r was-node-suite-comfyui/requirements.txt
then restart. On the Windows portable build, run the pip step with python_embeded\python.exe -s -m pip install -r ... (or use install.bat) so dependencies land in ComfyUI's own Python.
Common issues & troubleshooting
Lifted shadows look gray and muddy. You pushed too far. Rescuing shadow detail and flattening contrast are the same slider in different amounts - back it off until the darks still read as dark, just with detail. If the image genuinely has no information in the shadows (crushed to pure black), no amount of lifting invents it; you'll only amplify compression noise.
Halos around high-contrast edges. Range-based tonal tools can leave a faint glow where a bright area meets a dark one - that's the radius/softness control at work. If you see a halo, adjust the radius rather than the amounts.
Banding in smooth gradients. Skies and soft backgrounds can show stair-stepping after a strong adjustment, especially at 8-bit. Ease the correction, or do heavier tonal work before upscaling so there are more pixels to hide the transition in.
The suite won't import. WAS Node Suite is a big, unmaintained-since-late-2023 pack, and its trademark failure is an "Import Failed" after a ComfyUI update - a dependency version clash, opencv the usual offender (and worse if you also run ReActor/insightface). Reinstall the requirements against your ComfyUI Python and restart; the node works, it's the suite install that occasionally breaks.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The image to adjust. A batch is handled one image at a time. | |
| shadow_threshold | FLOAT | 75.00–255 | How dark a pixel has to be, on a 0-255 brightness scale, to count as shadow. 75 takes in the darker quarter of the range; raising it to 150 pulls in the midtones as well, and 0 selects nothing. |
| shadow_factor | FLOAT | 1.5-12–12 | What the shadow area is multiplied by. 1.0 leaves it alone, 1.5 lifts it by half again to reveal detail, 0.5 darkens it further, and 0 makes it solid black. |
| shadow_smoothing | FLOAT | 0.3-255–255 | Blur radius in pixels applied to the shadow selection, which feathers the edge of the adjustment so it does not show a hard outline. The blur runs twice, so the softening is wider than the number suggests: 0.25 is a hairline, 8 is a broad fade. |
| highlight_threshold | FLOAT | 175.00–255 | How bright a pixel has to be, on a 0-255 brightness scale, to count as highlight. 175 takes in the brighter third of the range; 255 selects nothing. |
| highlight_factor | FLOAT | 0.5-12–12 | What the highlight area is multiplied by. 1.0 leaves it alone, 0.5 halves it to pull back blown-out brights, and values above 1.0 push the highlights further towards white. |
| highlight_smoothing | FLOAT | 0.3-255–255 | Blur radius in pixels applied to the highlight selection, feathering the edge of that adjustment. As with shadow_smoothing the blur runs twice, so the effective fade is wider than the radius. |
| simplify_isolation | FLOAT | 0.0-255–255 | Blur radius in pixels applied to the brightness reading before either region is cut, which merges scattered specks into solid areas. 0 keeps the selections pixel-exact; 4 or more gives broader, smoother regions. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The adjusted image, with the original colours restored over it. |
| shadow_map | IMAGE | Greyscale map of the area treated as shadow: white where the adjustment applied at full strength, black where it did not. |
| highlight_map | IMAGE | Greyscale map of the area treated as highlight, on the same white-is-adjusted reading as shadow_map. |