π§ Luminance Preprocess
Grayscale that actually follows how your eyes perceive light
- image
- image
π§ Luminance Preprocess turns a color image into a proper perceptual grayscale - and by "proper" I mean it doesn't do the naive "average the channels" thing that makes green and red collapse into the same gray. It pulls the L* (lightness) channel out of CIELAB color space, which is designed so that equal numeric steps look like equal brightness steps to a human eye. The output is a clean 3-channel grayscale image where the luminance relationship between pixels is honest.
So when would you actually want that? The pack ships it under Tiling, and the intended pairing is with the same pack's Color Match Luminance node: you build a luminance map of a reference tile or image, then use it to match exposure across a tiled upscale so seams don't flash brightness differences. It's also handy as a generic brightness/contrast analysis image, or a source for any luminance-based ControlNet preprocessor that expects a neutral map instead of raw color.
How it works
The pipeline is straightforward color science:
- Convert sRGB β XYZ (D65 illuminant).
- Convert XYZ β LAB.
- Take the L channel (range 0β100).
- Normalize to 0.0β1.0 and replicate it into all three channels.
That last step is the part worth knowing: the output is not a single-channel mask, it's a 3-channel IMAGE with R = G = B = L. So it plugs into any IMAGE socket, not a MASK socket. There's one input (image, the colored RGB image) and one output (image, the grayscale luminance image). If you need a binary mask out of it - say, to isolate bright regions - you'll have to threshold it separately.
Installing it
Part of ComfyUI-SuperNodes (GitHub: sonnybox/ComfyUI-SuperNodes) by SuperCC. In ComfyUI Manager, search SuperNodes and install, then restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/sonnybox/ComfyUI-SuperNodes
# restart ComfyUI
The only pip dependency is matplotlib, and there are no model downloads for the utility nodes. The pack needs a recent ComfyUI because it's built on the newer comfy_api extension interface - if you install and see no SuperNodes, update ComfyUI first.
Where people trip
The IMAGE-vs-MASK thing is the big one. It looks grayscale, so beginners try to feed it into a mask input and get a type mismatch. If you want an actual mask, add a threshold or mask-from-image node after it. And keep your expectations on the "preprocess" part: this node only extracts luminance, it doesn't match or correct anything. The matching is the other node's job.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The original, colored RGB image. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | The grayscale luminance image. |