ComfyUI Node

Lighten (HSL)

When the model loves shadows a little too much

By maludwig·Created 2 years ago·Updated about a year ago· 6
Lighten (HSL)
  • image
  • mask_opt
  • image
masked_areatrue
factor0.5

Here's the scenario the author wrote this for: you want a scorching bright desert, and the model keeps painting in shadows so deep they read as black holes. Lighten (HSL) is the direct counter. It's one node in the tiny Basix Image Filters pack, image in, image out, and its whole job is pushing the lightness of an image upward. If "shadowy and moody" is what you actually wanted, this is not the node - that's the Darken sibling, and the HSV variant if you want to keep colors intact.

How it works

The node converts the image from RGB to HSL, adds your factor to the lightness channel, clamps to the valid range, and converts back to RGB. Because it's HSL lightness rather than HSV brightness, the character of the lightening is "toward white," not "toward bright." Red becomes light red - pink - rather than saturated bright red. The README's example image makes this visceral: HSL Lighten washes a color out as it lifts it, HSV Brighten doesn't. If that distinction matters to you, pick accordingly; if it doesn't, either will do the job.

The inputs that matter

Just three, and the layout is shared by the whole pack:

  • image - any IMAGE tensor (Load Image, VAE Decode, whatever).
  • factor (default 0.5, range −1 to 1) - the amount added to lightness. 0 is no change; 0.5 lifts pure black to 50% gray; 1 pushes everything to white. Negative values darken instead, so one node covers both directions.
  • masked_area + optional mask_opt - the pack's standard mask handling.

Output is one image tensor, same dimensions as the input. Wire it to whatever the original was feeding and you're done.

Two things that will trip you up

First, the copy-paste bug: the in-UI description for Lighten literally says "Darken an image by adjusting its brightness in HSL color space." It's a stale description string in the code, not the behavior - the node lightens. Test it on one image and you'll see it immediately.

Second, remember you can go negative. People reach for Lighten when the image is too dark, but the same node set to −0.3 is a perfectly good soft darken, since it just subtracts from lightness. One node, both directions, no reason to add another.

Installing it

Through ComfyUI Manager, search "Basix Image Filters" (repo basix_image_filters), install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/maludwig/basix_image_filters

Then restart ComfyUI. No models, no keys, no exotic dependencies - the pack is plain torch math, so it installs clean and costs nothing at load time.

The workflow trick that makes it shine

Lift the image with Lighten, then run it back through an img2img pass at 0.7–0.9 denoise. The sampler takes your lightened image as a hint and tends to respect the brighter, airier tone instead of re-shading everything. For surgical use - "this corner is fine, it just shouldn't be pitch black" - feed the original through mask_opt, make a mask in ComfyUI's MaskEditor (right-click a Preview Image node → Copy (Clipspace), paste into a Load Image node, right-click → Open in MaskEditor), and toggle masked_area to choose whether the mask or everything outside it gets lifted.

CategoryImage Filters

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
masked_areaBOOLEANtrue
factorFLOAT0.5-1–1
mask_optoptMASK

Outputs (1)

NameTypeDescription
imageIMAGE