Darken (HSL)
The fix when your dungeon comes out lit like an operating room
- image
- mask_opt
- image
You know the workflow: you prompt for a dark dungeon corridor, and the model gives you a corridor lit like an operating room. That's the exact use case this node exists for. Basix Image Filters is a small no-frills pack from maludwig, and every node in it is the same shape - an image goes in, an image comes out, and an optional mask lets you confine the edit. Darken (HSL) is the one you reach for when "dungeon" keeps coming out bright.
How it works
The node converts your image from RGB into HSL color space, subtracts the factor from the lightness (L) channel, clamps everything to a valid range, and converts back. Because it works on lightness rather than brightness, darkening in HSL drags colors toward black - pure white with a factor of 0.5 becomes 50% gray, and colors lose some punch as they sink. If you want to darken without desaturating the colors, that's what the HSV version of this node is for; here in HSL land, darkening and graying come as a package.
The inputs that matter
There are only three, and two of them are the pack's standard plumbing:
image- any IMAGE tensor. Wire this from a Load Image, a VAE Decode, or basically anything that outputs an image.factor(default 0.5, range −1 to 1) - the amount subtracted from lightness. 0 is no change. 0.5 turns pure white into 50% gray. 1 makes everything black. Negative values lighten instead, which is a handy way to get a single node that can go either direction.masked_area+ optionalmask_opt- the pack-wide mask system (more below).
The output is a single image tensor, same shape as the input, so it plugs straight into whatever the original image was feeding.
The honest gotcha
The in-UI description for this node claims "a factor of 0.0 results in a completely black image, while a factor of 1.0 gives the original image." That's backwards - the shipped code does lightness -= factor, so 0 is no change and 1 is black. Trust the README and the behavior, not the tooltip. It's a small node, so it's cheap to just test both ends of the slider and see.
Installing it
Two ways, same result:
- ComfyUI Manager: search for "Basix Image Filters" (the repo is
basix_image_filters), hit install, restart. - Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/maludwig/basix_image_filters, then restart ComfyUI.
There's nothing heavy here - no model downloads, no API keys, no fancy requirements. The whole pack is torch tensor math, so install is about as clean as a custom node gets.
Using it like the author intends
The README's own framing is the best one: feed a darkened image back through an img2img pass at 0.7–0.9 denoise, and the sampler will match the darker, moodier tone instead of re-brightening everything. And for "this image is fine except this one area," the optional mask_opt input works with ComfyUI's built-in MaskEditor - make a mask via the Clipspace right-click menu on a Preview Image node, then toggle masked_area between modify_masked and modify_unmasked to flip which side of the mask gets darkened without drawing a second one. That's the whole trick, and it's why this little pack is surprisingly handy.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| masked_area | BOOLEAN | true | — |
| factor | FLOAT | 0.5-1–1 | — |
| mask_optopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |