Color Desaturate (MD)
The desaturate node with a Mode dropdown
- image
- mask
- image
Desaturation seems like the most boring thing a node can do - it's a right-click in every photo editor. But mdColorDesaturateDesaturate is a reminder that "convert to grayscale" has five different answers, and they don't look the same.
The five modes (this is the whole node)
- Luminance -
0.22R + 0.72G + 0.06B, the perceptually-weighted formula. This is the one that matches how bright things look: a green object converts brighter than a red one of equal intensity. It's the default and the right choice for 95% of work. - Luma - in this implementation the same weights, applied to the non-linearized signal. Luminance vs. luma is a gamma subtlety; here they behave close enough that you won't feel the difference on typical AI output.
- Lightness (HSL) -
(max + min) / 2of the RGB channels. Flatter, softer grayscale; useful when luminance looks too contrasty. - Avg (HSI Intensity) -
(R + G + B) / 3, the plain average. This is the "no opinion" grayscale. Fine for texture work, usually mushier than luminance for photos. - Value (HSV) -
max(R,G,B). The brightest, most contrasty of the five - good for a bold graphic look, bad for preserving tonal subtlety.
The practical lesson: if your B&W looks wrong, it's often not wrong, it's the wrong formula. A flat-looking conversion is usually an Avg or Value result when what you wanted was Luminance. The good news is you can A/B all five in seconds by flipping the Mode dropdown and re-running.
Around it
- image in, image out, optional mask (per-pixel blend strength). RGB and RGBA both work, alpha preserved.
- No other controls. That's the appeal - desaturate is a lookup, not a tuning exercise.
Where it sits
MdColorMod gives you three routes to grayscale and they serve different jobs: this node (fast, formulaic, five presets), the mono mixer (weighted, controllable, for when the result matters), and the extract node (when you actually want a mask out of the color channels, not an image). For the "just desaturate it" case, this is the one you want. It's the kind of deterministic post-pass our post-processing notes argue should live in every finishing workflow - instant, no model, no re-gen required. One thing to know: if "desaturated" is an intermediate step in a bigger grade, desaturating early and re-saturating later is a common way to control the final color pop - this node is the clean first half of that trick.
Installing
The usual:
cd ComfyUI/custom_nodes
git clone https://github.com/MdONeilsl/ComfyUI-MdColorMod
or ComfyUI Manager → "MdColorMod", restart. Empty requirements.txt, pure torch, no downloads, GPL-3.0, and young enough that Manager might not list it yet - clone manually if so.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image tensor. | |
| Mode | COMBO | Luminance | Desaturation method. |
| maskopt | MASK | Optional mask to restrict the adjustment area. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The desaturated image. |