[Inference.Core] Image Luminance
The ControlNet preprocessor for recoloring
- image
- IMAGE
If you've ever wanted to colorize an old black-and-white photo, or completely repaint an image's colors while keeping every shadow and highlight exactly where it was, this is the node that makes it possible. Image Luminance is a ControlNet preprocessor built for exactly one job: strip an image down to a pure brightness map so a Recolor ControlNet can condition on where the light and dark areas are without caring at all what color they used to be.
That distinction matters. Most preprocessors extract structure - edges, depth, pose. This one extracts luminance, which is a different axis entirely. Feed a photo through it, and you get a grayscale map where the only information left is "how bright was this pixel." Wire that into a Recolor ControlNet model alongside a normal prompt, and the diffusion model treats the luminance map as a hard constraint on light and shadow placement while your prompt (and the model's own priors) decide the actual colors. That's the whole trick behind "colorize this B&W photo" and "repaint this photo in a completely different palette" workflows - you're not asking the model to invent lighting, just color.
Inputs and outputs
There's really only one input worth tuning: gamma_correction (0.1 to 2, default 1). It reshapes the luminance curve before it's handed off, the same way gamma correction works on a monitor - push it below 1 and midtones get brighter, push it above 1 and they darken. If your recolored output is coming out flatter or more contrasty than you expected, this is the first knob to touch, not the ControlNet's own strength setting. resolution (64–2048, default 512) is the standard preprocessor resize-before-processing control you'll see on every node in this pack - it sets what size the image gets scaled to internally before the luminance extraction runs.
The single output is IMAGE - the luminance map itself. Wire it straight into a ControlNet Apply node loaded with a Recolor checkpoint, running alongside your usual base model and prompt.
Installing it
This ships as part of LykosAI's Inference Core Nodes pack, so you get it the moment you install the pack - there's no separate node to hunt down. Easiest route is ComfyUI Manager: search for "ComfyUI-Inference-Core-Nodes" and install. Manually, it's the usual custom-nodes drill:
cd ComfyUI/custom_nodes
git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes
then either run install.py from your ComfyUI Python environment, or pip install -e . (add [cuda], [cuda12], [rocm], or [directml] for the accelerated onnxruntime build matching your hardware) and restart ComfyUI. Worth knowing: this particular node doesn't actually need any of that ONNX acceleration - it's plain image math, not a neural network - so it's the one preprocessor in the pack that "just works" regardless of which install variant you picked, and there's no model file to download.
Where it trips people up
The biggest gotcha isn't the node itself, it's finding a Recolor ControlNet checkpoint to pair it with. Recolor conditioning is largely an SD 1.5-and-SDXL-era thing - it was never carried into the newer "union" ControlNet models trained for Flux, Qwen-Image, or Z-Image (the closest modern equivalent is the "gray" mode some 2025-26 union models ship, which is a related but not identical idea). If you're on a current-generation base and can't find a dedicated Recolor model, that's not a bug in your setup - the ecosystem genuinely didn't rebuild that specific condition type for newer architectures, and SD 1.5/SDXL is still where this workflow lives.
Beyond that, the usual failure mode is output that looks washed out or oddly flat - that's almost always a gamma_correction or ControlNet-weight issue rather than anything wrong with the luminance extraction itself. Push gamma_correction up or down before you start second-guessing the rest of your graph.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| gamma_correctionopt | FLOAT | 1.0000.1–2 | — |
| resolutionopt | INT | 51264–2048 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |