Nodes/radiance/Relight Engine
ComfyUI Node

Relight Engine

One synthetic light, one normal map, no re-render

By FXTD-Studios·Created 8 months ago·Updated about 18 hours ago· 246
Relight Engine
  • image
  • normal_map
  • camera
  • image
  • lighting_pass_only
◄light_dir_x1.00►
◄light_dir_y1.00►
◄light_dir_z1.00►
◄light_color_r1.00►
◄light_color_g1.00►
◄light_color_b1.00►
◄diffuse_intensity1.00►
◄specular_intensity0.50►
◄specular_roughness0.10►

Relight Engine adds a light to an existing image using its normal map - Lambert diffuse plus Blinn-Phong specular, direction and colour under your control. It's the small, fast, one-light sibling of Multipass Relight: no albedo, no roughness, no metallic, no PBR bookkeeping. Image in, normals in, lighting added on top.

That's a narrower tool than the name suggests, and the pack's own known-issues list says so plainly: it "adds one directional light", it's added to the image rather than multiplied by an albedo, and there's no environment map. If you want a real relight - new key, correct diffuse/specular split, HDR output - use Multipass Relight with real or estimated passes. If you want to make a flat AI face read as more three-dimensional, or pull a rim light onto a subject, this is the cheap tool.

How it works

image is what gets lit and normal_map is the geometry. The normals are expected as the usual 0..1 encoded RGB (RGB = XYZ × 0.5 + 0.5), and if the map's resolution differs from the image it gets resized - which is convenient, and also means a badly-matched normal map silently gets squashed into agreement instead of complaining.

The light is three direction components: light_dir_x (default 1), light_dir_y (default 1, positive = from above), light_dir_z (default 1, positive = in front of the surface). They're normalised internally, so the numbers set an angle, not a magnitude - you can't make the light stronger by typing 5. Strength comes from diffuse_intensity (0–10, default 1) for the broad Lambert term and specular_intensity (0–10, default 0.5) for the highlight. specular_roughness (0.01–1, default 0.1) is the Blinn-Phong exponent: low is sharp metallic glints, high is a soft matte sheen.

light_color_r, _g, _b (0–2) tint the light. Values above 1.0 push into HDR emission, which is a nice touch - you can let the light itself drive values above white and then tone map.

The optional camera input is the fiddly one, and it's honest about what it does: only the position in the camera's transform is used, as the viewpoint for the specular term relative to a -1 to 1 image plane. Without it, the node assumes a viewer at z = 2. So the diffuse term doesn't care about the camera at all, and the specular term cares about exactly one number from it. If your highlights look like they're coming from the wrong side, that's the input to reach for.

Two outputs: image, the original with the lighting added, and lighting_pass_only, the light by itself - the one to grade separately or multiply into a different plate.

Install

Ships with Radiance as part of the HDR group. ComfyUI Manager → search Radiance → install → restart → refresh. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/fxtd-studios/radiance.git
cd radiance
python -m pip install -r requirements.txt

It's tensor maths - no models, no downloads, no GPU-heavy work beyond what the tensor already costs. If you don't have normals, the rest of the pack will happily produce some (Multipass Estimate's geometry passes, or any depth/normal preprocessor), and the KB's depth-estimation.md covers where those come from and how much to trust them.

Where people get burned

  • It adds to the image, so it adds to everything. A picture that's already brightly lit gets brighter, including its shadows - this isn't a light rig, it's a light added on top. Dial diffuse_intensity down rather than expecting the node to respect the original shading.
  • Normals pointing the wrong way. A DirectX-convention normal map (green flipped) lit as OpenGL gives you lighting that looks plausible but inverted. Relight Engine has no convention switch - Multipass Relight does. Check your source.
  • Cranking light colour above 1 and then wondering why everything clips. Above 1.0 is HDR emission by design; if your pipeline's next stop is an 8-bit save, that value is a bright white blob.
  • Expecting it to fix a bad normal map. AI-estimated normals have soft, approximate geometry. The light will follow their errors faithfully.
CategoryFXTD STUDIOS/Radiance/VFX

Inputs (12)

NameTypeDefaultDescription
imageIMAGEImage to light. The lighting pass is added on top of it, not multiplied by an albedo.
normal_mapIMAGENormal map encoded 0 to 1 (RGB = XYZ x 0.5 + 0.5). Resized to the image if the sizes differ.
light_dir_xFLOAT1.00-2–2Light direction X component. Normalized internally — sets the horizontal angle of the synthetic light.
light_dir_yFLOAT1.00-2–2Light direction Y component. Positive = light from above.
light_dir_zFLOAT1.00-2–2Light direction Z component. Positive = light in front of surface.
light_color_rFLOAT1.000–2Red component of the synthetic light color. Values > 1.0 produce HDR emission.
light_color_gFLOAT1.000–2Green component of the synthetic light color.
light_color_bFLOAT1.000–2Blue component of the synthetic light color.
diffuse_intensityFLOAT1.000–10Lambertian diffuse reflection strength. Controls broad, soft illumination.
specular_intensityFLOAT0.500–10Specular highlight strength. Higher values produce brighter, more visible glints.
specular_roughnessFLOAT0.100.01–1Surface roughness for Blinn-Phong specular. Low = sharp glints (metallic), high = soft broad highlights (matte).
cameraoptRADIANCE_CAMERAOptional camera. Only the position in its transform is used, as the viewpoint for the specular term relative to a -1 to 1 image plane. Without it a viewer at z = 2 is assumed.

Outputs (2)

NameTypeDescription
imageIMAGE—
lighting_pass_onlyIMAGE—