Image Desaturate (Badman)
Grayscale with a choice of luminance formula
- image
- IMAGE
"Turn this image gray" sounds like a solved, one-way operation, but there isn't actually a single correct way to collapse RGB into a single brightness value - the different formulas for it were developed for different reasons, and they give visibly different results on the same image. This node gives you four of them plus a strength dial, instead of hardcoding one and hoping it's the one you wanted.
The four methods, and why they differ
- Luminance (Rec.709) weights green heaviest, red next, blue least - it's the standard used for modern HD and digital video, and it's the formula that best matches how human vision perceives brightness (we're most sensitive to green light, least to blue). This is the one to reach for by default if you just want a natural-looking grayscale conversion.
- Luminance (Rec.601) is the older broadcast-TV standard, weighted slightly differently. The difference from Rec.709 is subtle on most images, but it exists - if you're matching a grayscale conversion done in older video or broadcast tooling, this is the formula that will line up with it.
- Average just means the flat mean of R, G, and B with no perceptual weighting at all. It's the crudest of the four and tends to make blues look brighter and reds look darker than they'd appear to your eye - useful mainly as a baseline or when you specifically want an unweighted, purely mathematical desaturation rather than a perceptually accurate one.
- Lightness is the HSL-style formula: the average of the maximum and minimum channel values for each pixel. It behaves differently from the two luminance options especially on saturated colors, and it's the one most likely to surprise you if you're expecting a luminance-style result - worth comparing side by side before committing to it.
Inputs and outputs
Three required fields:
image- theIMAGEto desaturate.factor(float, 0–1, default1, step0.05) - how far to push the desaturation.1is fully desaturated (grayscale),0leaves the image untouched, and anywhere in between gives you a partial desaturation - a genuinely useful middle ground for a muted, slightly-drained-color look without going full black-and-white.method- the enum above:luminance (Rec.709),luminance (Rec.601),average, orlightness.
One output: the adjusted IMAGE.
Installing it
ComfyUI Manager: search ComfyUI-BadmanNodes, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/MariusKM/ComfyUI-BadmanNodes
No dependencies or downloads to worry about - this is a per-pixel weighted average, nothing more.
Where people get tripped up
The most common surprise is expecting all four methods to look basically the same and being caught off guard by how different average and lightness look compared to the two luminance options, especially on saturated, colorful source images - a bright red and a bright blue that look roughly equally "bright" to your eye can come out at noticeably different gray values under average, while the luminance methods correct for exactly that. If a desaturated result looks off in a way you can't pin down, try switching methods before assuming something else is wrong - it's often just the wrong formula for what your eye expects. And remember factor is linear, not perceptual - 0.5 doesn't necessarily look like "halfway to gray" to your eye on every image, so if you're chasing a specific partial-desaturation look, it's worth nudging the slider by eye rather than trusting the number alone.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| factor | FLOAT | 1.000–1 | — |
| method | COMBO | 4 options: luminance (Rec.709), luminance (Rec.601), average, lightness |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |