Desaturate (HSV)
Gray it out and keep the tones exactly where they are
- image
- mask_opt
- image
Desaturate (HSV) removes color from an image, and - same story as its Saturate twin - the author freely admits it's probably identical to the HSL Desaturate node. Saturation is saturation in both color spaces, so the math is the same. What this node is not: a brightness tool. It touches only the saturation channel, which means you can drain a scene to near-gray and keep every shadow and highlight exactly where they were. That's a specific, useful thing to be able to do, and it's the whole reason to reach for it.
How it works
Convert the image to HSV, subtract the factor from the saturation channel, clamp, convert back to RGB. Hue and value are untouched. The useful consequence: your tonal structure is preserved perfectly, so desaturating a bright image gives you a bright grayscale image, and desaturating a moody one keeps it moody. If you want a grayscale result that still reads with the original lighting, this is the honest way to get it without mucking around with channel math yourself.
The inputs that matter
image- any IMAGE tensor.factor(default 0.5, range −1 to 1) - the amount subtracted from saturation. 0 is no change; 1 is fully grayscale; negative values saturate instead.masked_area+ optionalmask_opt- the pack's standard masking.
Output: one image tensor, same dimensions as the input.
What to keep in mind
The in-UI description is inverted again - it claims factor 1 gives the original and factor 0 gives full desaturation, but the code does saturation -= factor, so 0 is original and 1 is gray. You get the pattern by now: this pack's description strings are stale; the code and the sliders are the truth.
Since this is the same operation as HSL Desaturate, don't overthink the choice. Pick whichever sibling you're already using for consistency. The only real decision is how much gray you want, and the factor slider is the whole answer.
Installing it
ComfyUI Manager → search "Basix Image Filters" (repo basix_image_filters) → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/maludwig/basix_image_filters
Restart after. No models, no keys, no heavy dependencies - the pack is pure torch math.
Using it well
The img2img hint pattern applies here better than most: desaturate a reference, feed it back through the sampler at 0.7–0.9 denoise, and the model tends to reproduce the drained palette instead of re-saturating everything from its training bias. For a partial grade - keep the subject colorful, gray out the background - use mask_opt with a MaskEditor mask and flip masked_area to choose which side gets drained. One mask, two modes, zero redrawing; that's the trick this pack is built around.
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 | — |