Nodes/Comfyui-LG_Relight/🎈LG Relight Basic
ComfyUI Node

🎈LG Relight Basic

The no-popup relight node that actually batches

By LAOGOU-666·Created 2 years ago·Updated about a year ago· 217
🎈LG Relight Basic
  • image
  • normals
  • IMAGE
x0.500
y0.500
z1.000
brightness1.000
shadow_range1.000
shadow_strength1.000
highlight_range1.000
highlight_strength1.000
highlight_color#FFFFFF
shadow_color#000000

Most "relight" nodes in ComfyUI open a window in your face when you run them. LG Relight Basic is the one that doesn't. It's the headless, pure-math member of the LAOGOU Relight family: you feed it an image and a normal map, set a light direction with a few sliders, and it returns a relit image without ever stopping to ask you anything. That makes it the version you'd actually wire into a batch job, an API, or a workflow you run at 2am while you sleep.

It comes from the same pack as the fancier interactive nodes (LG Relight, LG Relight Ultra) by the Chinese node author LAOGOU-666. Those open a three.js editor so you can drag a light around with your mouse. Basic is the same underlying lighting math with the editor stripped out - deterministic, reproducible, and fast.

How it works

The math is a cheap but honest 3D lighting approximation. Your normal map (a color image where each pixel's RGB encodes which direction that surface faces) gets remapped from 0–1 to −1..1 vectors. Your x, y, z sliders define the light direction, also normalized to a unit vector. The dot product of normal and light gives a per-pixel diffuse brightness, which drives the shadow and highlight masks that multiply the original image. Highlight and shadow colors then tint those regions. Nothing is generated, nothing is hallucinated - it's the same light-transport idea IC-Light leans on, just computed directly instead of learned.

The inputs that matter

You only ever touch a handful of these:

  • x, y, z - where the light sits. x/y default to 0.5 (centered); z defaults to 1, meaning head-on toward the viewer. Push z negative and the light comes from behind.
  • brightness - a simple overall gain (0–3, default 1).
  • shadow_range / shadow_strength and highlight_range / highlight_strength - how wide and how strong the dark and bright sides of the light get. Leave them at 1 until the direction looks right.
  • highlight_color / shadow_color - hex strings like #FFFFFF and #000000. Want a warm sunset side and a cool shadow? This is where.

Output is a single IMAGE - the relit version, same size as the input. The node resizes the normals to match the image, so mismatched resolutions won't blow up on you.

Installing it

Same story as the whole pack - no model downloads, no requirements.txt, nothing heavy:

ComfyUI Manager → Install Custom Nodes → search "Comfyui-LG_Relight"

Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui-LG_Relight

Restart ComfyUI after installing, and hard-refresh the browser tab. That's it - the whole pack is one Python file plus a bit of frontend, and it only needs torch, numpy and PIL, which ComfyUI already has.

Where people get burned

The classic mistake is feeding it a normal map that doesn't match the image - a normal map from a different crop, or a depth map by mistake. The relight will come back looking flat and wrong, and the node will happily take the blame. Also remember the normals convention: if your shadows land on the wrong side of your subject, flip x (mirror it around 0.5) rather than re-exporting everything. And since it's a single light, the author's own README says the effect is limited on its own - it's meant to sit in a chain with something like IC-Light for the heavy lifting. For one node that never asks you a question, that's a fair trade.

Category🎈LAOGOU/Relight

Inputs (12)

NameTypeDefaultDescription
imageIMAGE
normalsIMAGE
xFLOAT0.5000–1
yFLOAT0.5000–1
zFLOAT1.000-1–1
brightnessFLOAT1.0000–3
shadow_rangeFLOAT1.0000–2
shadow_strengthFLOAT1.0000–2
highlight_rangeFLOAT1.0000–2
highlight_strengthFLOAT1.0000–2
highlight_colorSTRING#FFFFFF
shadow_colorSTRING#000000

Outputs (1)

NameTypeDescription
IMAGEIMAGE