Nodes/ComfyUI-TextureAlchemy/Color to Grayscale
ComfyUI Node

Color to Grayscale

Not All Grayscales Are Equal

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Color to Grayscale
  • color
  • grayscale
methodluminance

Take any RGB image, convert it to grayscale, and you've lost information - but how you lose it changes what you keep. Color to Grayscale gives you six different conversion methods so you can grab the brightness information you actually care about: the perceptually-correct luminance for photos, a flat average for masks, or a single raw channel when you specifically want the red content of a texture. For PBR work this is the "derive one map from another" node - turning an albedo into a roughness or height starting point, or extracting a single channel from a packed texture.

It lives in the Channel category of amtarr/ComfyUI-TextureAlchemy, and it's one of those small utilities that quietly does most of the work in a material pipeline.

How it works

Each method is a different formula for collapsing three channels into one:

  • luminance (default) - the perceptual Rec. 709 weighted sum: 0.2126R + 0.7152G + 0.0722B. This is what your eyes consider "correct" brightness, and it's the one to use for photos and most albedos.
  • average - (R+G+B)/3. Fast and dumb; good enough for masks where perceptual accuracy doesn't matter.
  • lightness - (max+min)/2. Preserves the tonal range, flattens saturation differences.
  • red_only / green_only / blue_only - extract a single channel outright. Handy for pulling one channel out of an ORM or RMA packed texture, or when the info you need happens to live in a specific channel.

Output is a grayscale IMAGE - as an RGB image with the gray repeated across channels, because that's what most ComfyUI image nodes expect to chew on.

Where it slots in

The killer use in this pack: an albedo is usually your cleanest, most detailed map, so grayscaling it with luminance gives you a legit starting point for a roughness or height map when Marigold's raw outputs are thin. The red_only/green_only options are how you unpack a channel-packed texture (AO in red, roughness in green, metallic in blue - the pack's own ORM preset) without touching the fancier unpacker nodes.

Installing it

Ships inside TextureAlchemy:

cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy

restart, and it's under Texture Alchemist → Channel. ComfyUI Manager: search "Texture Alchemy". No extra dependencies.

Gotchas

Don't use average for anything that'll be looked at - it visibly darkens reds and makes skin and brick look wrong. For photographic sources the difference between average and luminance is the difference between "close enough" and "actually correct." Also, this node outputs RGB-with-gray-repeated, not a single-channel MASK: if the node downstream insists on a MASK or single-channel input, you'll need to convert. And a pure grayscale input is fine to feed in - the node just re-repeats it - but it's wasted work, so only run it when you actually have color data to collapse.

CategoryTexture Alchemist/Channel

Inputs (2)

NameTypeDefaultDescription
colorIMAGE
methodCOMBOluminanceConversion method: luminance (perceptual), average, lightness (min+max/2), or single channel

Outputs (1)

NameTypeDescription
grayscaleIMAGE