Image to Black & White (Purz)
Grayscale done the way it should be
- image
- image
Desaturating an image sounds like the easiest thing in the world - and then you realize a lot of "convert to grayscale" nodes just average the channels and give you a muddy gray mess. PurzImageToBlackWhite does it properly. It takes an IMAGE, applies a real luminance weighting, and returns an IMAGE where the tones actually look like a photograph instead of a washed-out blend.
It's the simplest node in the ComfyUI-Purz pack - one input, one output, zero parameters - which is exactly why it's worth having around. The pack is by PurzBeats, a Comfy Org staffer, and this is the kind of quiet utility that earns its place in a workflow without ever asking you to think about it.
Why you'll use it
Grayscale is a staging step more often than a final look. Common paths: you're building a B&W aesthetic and want the color decision made before the model touches it, or you're converting a reference image to grayscale for a canny/lineart conditioning pass where color only adds noise. It also plays nicely with the pack's own Edge Detect node - feed it a grayscale image and the edges come out cleaner. If you're doing old-photo or noir work, this is the honest conversion, not the lazy one.
How it works
The node computes luminance per pixel using the standard Rec. 601 weights:
Y = 0.299·R + 0.587·G + 0.114·B
The green channel gets the most weight because human vision is most sensitive to green - that's why the result looks "right" where a naive average looks flat. It runs directly on the tensor in PyTorch, so there's no conversion round-trip through OpenCV or PIL, and it loops over the whole batch so you can drop a whole frame sequence through it in one go.
The inputs and outputs
There's nothing to configure, which is the point. You feed in image (IMAGE), you get back image (IMAGE) - same shape, same dimensions, every channel now holding the same luminance value. It can sit anywhere in your graph: right after a VAE decode, before an upscaler, or inline in a batch. About the only thing to remember is that the output is still a 3-channel RGB image with R=G=B, not a single-channel tensor - so everything downstream that expects an IMAGE keeps working without complaint.
Installing it
Via ComfyUI Manager, search ComfyUI-Purz. Or manually:
cd ComfyUI/custom_nodes/
git clone https://github.com/purzbeats/ComfyUI-Purz.git
cd ComfyUI-Purz
pip install -r requirements.txt
Then restart ComfyUI. Requirements are OpenCV, Pillow, torch, and numpy - all things ComfyUI already ships. No models, no downloads beyond the pack itself. On a modern ComfyUI you get the V3 slider-based UI; older installs fall back gracefully.
The only gotcha
People occasionally expect this node to also output a MASK or a single-channel grayscale for use in mask math - it doesn't, and the output is plain RGB. If you need an actual mask, run the result through a color-to-mask node afterward. That's a two-second fix, and honestly the cleanest separation of concerns anyway.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |