Nodes/ComfyUI-Image-Filters/Relight (Simple)
ComfyUI Node

Relight (Simple)

Dot-product relighting — fast, local, and not IC-Light

By spacepxl·Created 3 years ago·Updated 8 months ago· 293
Relight (Simple)
  • image
  • normals
  • IMAGE
x0.000
y0.000
z1.000
brightness1.00

There are two very different ways to "relight" an image in this ecosystem. One is a diffusion model - IC-Light, or Qwen-Image-Edit's folded-in relight capability - that re-imagines the whole scene under new lighting, with all the model context and all the compute cost that implies. The other is what Relight (Simple) does: literal math. The README says it plainly - "basic dot product (Lambertian) relighting from a normal map." This is Lambert's cosine law, the same shading math game engines have used forever: take a surface normal, take a light direction, dot-product them, and that's your shading value. No model, no hallucination, no chance of it inventing a shadow or reflection you didn't ask for - it can only shade based on the normal map you feed it.

That's the honest trade-off. It's instant and fully deterministic, but it's shading, not rendering - it won't add believable global illumination, bounced light, or new shadow shapes the way a diffusion relighter can. If you've read about IC-Light's skin-tone-shift problems or the frequency-separation fixes people use around it, know that this node sidesteps all of that by not being a generative model in the first place - and also can't do what a generative model does.

The inputs

  • image (IMAGE) - required, what you're relighting.
  • normals (IMAGE) - required, a normal map for that image. This pack's own Normal Map (Simple) node is the natural pairing, though anything producing a normal map in the standard convention works - a ControlNet Normal BAE pass, or this pack's Depth to Normals node if you have real depth data.
  • x, y, z (each -1 to 1; defaults x=0, y=0, z=1) - the light direction vector. The default (z=1, x/y at 0) points the light straight at the camera - flat, minimal shading. Tilt x/y to move the light sideways or up/down for more dramatic directional shading.
  • brightness (default 1, 0–100) - overall light intensity multiplier.

One output: IMAGE.

What quality of normal map you feed it matters enormously

If you're pairing this with Normal Map (Simple), know that node's own limitation carries straight through here: it derives normals from local pixel gradients (a Scharr operator), not real geometry, so it captures fine texture but has no idea about the macro shape of the object. Relight built on that will convincingly shade fabric weave or skin texture while getting the big-picture "the object curves away from the light here" part wrong. For a relight that respects actual scene shape, you want normals derived from real depth data instead.

How to install it

ComfyUI Manager: search "ComfyUI-Image-Filters", install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Image-Filters

restart. Dependency is opencv-contrib-python; a cv2 import error is typically a conflicting opencv variant from another node pack, fixed on Windows with the author's install.bat/import_error_install.bat, or manually by uninstalling stray opencv installs and reinstalling opencv-contrib-python alone. No models, negligible compute - this is fast enough to iterate on interactively.

Common issues & troubleshooting

Result looks flat / barely shaded. The default light vector (z=1) is nearly frontal, which is intentionally subtle. Tilt x or y away from zero for visible directional shading, and check brightness isn't set too low.

Shading follows texture detail but not the object's overall form. That's the Normal Map (Simple) limitation described above, not a bug in this node - a high-frequency-only normal map can't encode macro shape it was never given. Use a depth-derived normal map if global form matters.

Expecting IC-Light-quality results. This node cannot invent lighting information that isn't already implied by the normal map you feed it - no new shadows, no relit background, no material response. For a full generative relight, IC-Light or Qwen-Image-Edit's relight capability is the right tool; reach for this one when you specifically want fast, deterministic, local shading math instead.

CategoryImage-Filters/image

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
normalsIMAGE
xFLOAT0.000-1–1
yFLOAT0.000-1–1
zFLOAT1.000-1–1
brightnessFLOAT1.000–100

Outputs (1)

NameTypeDescription
IMAGEIMAGE