Image Luminance
The grayscale hint that drives Recolor ControlNet
- image
- IMAGE
This is the front half of a recoloring workflow. Image Luminance strips an image down to its brightness - a perceptually-weighted grayscale - and that grayscale becomes the condition for a Recolor ControlNet. The idea: keep the exact light and shade of the original, throw away all the color, and let your prompt repaint it. Colorize an old black-and-white photo, or take a color image and completely re-hue it while every highlight and shadow stays put. It's a small, specific tool, and for that job it's the right one.
How it works
The node computes luminance - brightness weighted the way the human eye perceives it, so greens read brighter than blues, not a flat channel average. That produces a grayscale map that preserves the tonal structure of the scene. You feed it into a recolor ControlNet (the README points at ioclab_sd15_recolor and the SDXL recolor LoRAs), and the model generates a full-color image that matches the brightness pattern exactly while taking all its color cues from your prompt. Because the luminance holds the composition, you get faithful shading with total freedom over palette.
The inputs that matter
It takes an image and returns an IMAGE - the luminance map - for your ControlNet Apply node. One meaningful knob:
gamma_correction(default 1, range 0.1–2) - bends the brightness curve. Below 1 lifts the midtones (brighter, flatter), above 1 deepens them (more contrast in the shadows). Nudge it if the recolor is coming out too washed or too murky; leave it at 1 for a faithful pass.
resolution (default 512) sets the working size.
Installing it
ComfyUI Manager: search ComfyUI's ControlNet Auxiliary Preprocessors, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Fannovel16/comfyui_controlnet_aux
pip install -r requirements.txt
Restart ComfyUI. No model download for this one - computing luminance is pure image math, so it works the instant the pack loads. (The recolor ControlNet is a separate download you'll need for the actual conditioning.)
Luminance vs Intensity
The pack ships a sibling, ImageIntensityDetector, and they're close but not identical. Luminance uses perceptual weighting (matching how bright colors look); Intensity is a simpler brightness measure. They map to recolor_luminance and recolor_intensity respectively. Luminance is the more natural-looking default for photo recoloring; try Intensity if you want a slightly different tonal read. Honestly, swap between them and eyeball which grayscale gives the nicer recolor.
Where people get burned
The classic mistake is expecting this node to recolor anything by itself - it only makes the grayscale hint. You need the recolor ControlNet loaded downstream, and that lives in the SD 1.5 / SDXL ecosystem, so run recolor workflows there. Second, if colors come out muddy or blown out, that's usually a gamma_correction or ControlNet-strength issue, not the luminance itself - adjust the gamma and dial the ControlNet weight before blaming the preprocessor.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| gamma_correctionopt | FLOAT | 1.000.1–2 | — |
| resolutionopt | INT | 51264–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |