Nodes/ComfyUI-NKD-VFX-Tools/😺NKD Relight
ComfyUI Node

😺NKD Relight

Move the Light Before the Model Invents One

By Nekodificador·Created 6 months ago·Updated a day ago· 155
😺NKD Relight
  • rgb
  • normals
  • depth
  • albedo
  • roughness
  • relit_image
â—„lights_config{}â–º

Prompting for "the same room, lit from the left" is a negotiation you usually lose - the model will nod and then light it however it wants. Relight is the fix for that: a photo in, dragged lights around a virtual sphere, and the image updates live on the node. You settle the lighting yourself, then hand the relit plate downstream as your img2img base or ControlNet reference, and the generation inherits your key light instead of inventing one.

How it works

It's a deterministic GPU pass, not a model. Normals come in as an RGB image, get decoded from [0,1] to [-1,1] and renormalized (with the Y flip for OpenGL's up convention), and depth becomes a luminance scalar. Then it's classic computer graphics: Lambertian diffuse plus Blinn-Phong specular, shaded per light, with an ambient term. Because the depth pass is right there, it also computes screen-space shadows from it - soft shadows with strength/softness/range, no geometry needed, which is the neat trick that makes a flat relight feel grounded. And it handles material: plug in albedo and roughness and the speculars stop looking plastic. delit_mix blends the original photo with the albedo as the base color, so you're not throwing away the plate's real texture.

There's no viewport sliders to enumerate here - the lighting lives in the node's own interactive sphere - but the two decisions that matter are which passes you feed it and whether you bother with albedo/roughness.

The inputs that matter

  • rgb, normals, depth - required. Any depth/normal nodes you already have will do; this pack ships no models, deliberately. Depth Anything or Marigold for depth, and whatever normal-estimator you run (or fSpy + a 3D placement if you're being fancy).
  • albedo, roughness - optional, but they're what make the speculars believable. Albedo is the surface color without lighting; roughness says how tight or broad the highlights are.
  • lights_config - the JSON carrying the lights, ambient color/intensity, delitMix, roughnessStrength and the shadow settings. You don't hand-edit this; the node's UI writes it.

The single output is relit_image.

Why not IC-Light?

Worth being precise, because relighting has a famous name: IC-Light is a diffusion-based relight that invents the lighting change convincingly, background included. This is the opposite tool - deterministic, screen-space, instant, and surgical. It won't fabricate a coherent relit background the way a diffusion model can, but it also won't rewrite your plate's pixels or run you a whole generation to see the result. The pack's own framing is the right one: this is for deciding the lighting before the model gets a say. They're complements, not rivals.

Install

The whole pack in one move: ComfyUI Manager, search "NKD VFX Tools", restart. No models, no extra downloads - numpy is the only hard dependency. If your relight looks flat, check the passes first: a normal map that's actually a depth map (or vice versa) makes everything read wrong, and that's a wiring fix, not a parameter problem.

Category😺NKD Nodes/Utils

Inputs (6)

NameTypeDefaultDescription
rgbIMAGE—
normalsIMAGE—
depthIMAGE—
albedooptIMAGE—
roughnessoptIMAGE—
lights_configoptSTRING{}—

Outputs (1)

NameTypeDescription
relit_imageIMAGE—