Nodes/comfy_Pond_Nodes/🐳图像去色
ComfyUI Node

🐳图像去色

A Photoshop-style desaturate with four different grayscale recipes

By Pondowner857·Created about a year ago·Updated 21 days ago· 45
🐳图像去色
  • image
  • 图像
去色方法亮度
去色强度1.00

Desaturating an image sounds like the most trivial thing you could ask a node to do - and mostly it is. But "grayscale" isn't one thing, and 🐳图像去色 (DesaturateImage) gets this exactly right by giving you four different ways to compute the gray value plus a strength slider to blend between color and grayscale. If you've ever wanted a specific flavor of B&W - the moody luminance version or the flat average version - this is the node.

The trick is that there are several defensible definitions of "how bright is this pixel." The node's 去色方法 (desaturation method) dropdown offers four:

  • 亮度 (luminance) - the weighted average 0.2126R + 0.7152G + 0.0722B (the ITU-R BT.709 coefficients, which the source comments describe as "similar to Photoshop"). Green carries most of the weight because the eye reads green as brighter than red or blue, which is why this is the one that looks "right."
  • 平均 (average) - plain (R+G+B)/3. Flat and neutral, produces the most even grays.
  • 最大值 (max) - takes the brightest channel. Produces a high-key, glowing result.
  • 最小值 (min) - takes the darkest channel. The moody, contrasty opposite.

Most B&W conversion happens with the luminance method and people never think about it again; the other three exist for when you want a specific look (max/min give you the "single channel" feel without choosing a channel).

The controls

  • image - the input.
  • 去色方法 - the four-way dropdown above.
  • 去色强度 - 0 to 1, default 1.0. The blend factor between the original and the desaturated version. This is the useful one: 0.5 gives you a muted, faded-color look rather than full grayscale, which is great for desaturated-but-not-dead aesthetics (muted skin tones, faded film looks).

Output

One IMAGE, still in RGB (this node keeps the 3-channel format rather than collapsing to a mask-like single channel), so it plugs straight back into any color pipeline or video workflow. The batch is processed frame by frame, so it applies consistently across a video sequence.

Install

From comfy_Pond_Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Pondowner857/comfy_Pond_Nodes
cd comfy_Pond_Nodes && pip install -r requirements.txt

Pure torch/numpy, no models, instant. The Advanced sibling (🐳图像去色(V2)) lets you dial in your own RGB weights - defaulting to the Rec.709 values - if you need more control than these four presets give you. For everyone else, this is the one to reach for: four recipes, one slider, done.

Category🐳Pond/颜色

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
去色方法COMBO亮度4 options: 亮度, 平均, 最大值, 最小值
去色强度FLOAT1.000–1

Outputs (1)

NameTypeDescription
图像IMAGE