Nodes/ComfyUI-IC-Light/Calculate Normals From Images
ComfyUI Node Runs on cloud

Calculate Normals From Images

Turning four IC-Light relights into a normal map

By kijai·Created 2 years ago·Updated about a year ago· 1,158
Calculate Normals From Images
  • images
  • mask
  • normal
  • divided
sigma10.00
center_input_rangefalse

This is the strangest node in the pack, and it's not really about relighting at all - it's a side effect of relighting. Because IC-Light was trained to keep light transport consistent across passes, several relights of the same subject from different directions are mutually comparable in a way that lets you back out an approximate surface normal map - which direction each part of the surface is facing - even though nothing in IC-Light was ever trained on 3D geometry. It's an emergent trick, not an advertised feature, and it's a genuinely niche node: most people running IC-Light for portrait or product relighting will never open it. It's for texture and material work, where you want the geometry information a normal map encodes.

How it works

Feed it four images of the same subject, lit from four different directions, and it compares how the surface responds under each light to infer which way each patch of surface faces - the same underlying idea as photometric stereo, just riding on IC-Light's relighting consistency instead of a dedicated 3D pipeline. In practice you'd generate the four inputs by running IC-Light (or LightSource + ICLightConditioning) four times on the same subject and seed, once per direction.

The inputs and outputs that matter

  • images (IMAGE) - a batch of exactly four, and order matters: the node's own description is explicit that it expects left, right, bottom, top, in that order. Feed them out of sequence and the normals will come out wrong.
  • sigma (default 10, range 0.01–100) - smoothing applied during the normal calculation.
  • center_input_range (BOOLEAN, default false) - toggle depending on whether your source images are in a 0–1 or a recentered −1/1 range; if the normal map looks off, this is the first thing to flip.
  • Optional mask - restrict the calculation to your subject, so background pixels don't pollute the result.

Two outputs, both IMAGE: normal - the normal map itself, in the usual colour-encoded-direction convention you'd recognize from any normal map - and divided, a second pass the node exposes alongside it.

How to install it

Standard for this pack: ComfyUI Manager, search "IC-light", install, restart; or git clone https://github.com/kijai/ComfyUI-IC-Light into custom_nodes and restart manually. No separate model download for this node - it operates purely on images you've already generated.

Common issues & troubleshooting

Normal map looks scrambled or inverted. Check your batch order first - left, right, bottom, top, exactly. This is the single most common mistake, since it's easy to build the batch in whatever order you happened to generate the images.

Result is noisy or unstable. The four inputs need to actually be consistent relights of the same subject - same seed, same pose, same crop, differing only in light direction. If they drifted (different seeds, slightly different generations), the "compare across lights" math has nothing solid to work with. Nail down your IC-Light batch before troubleshooting this node.

Normals look flat or washed. Try adjusting sigma - too high smooths away real surface detail, too low picks up noise as if it were geometry.

Output looks wrong and you can't tell why. Flip center_input_range and compare - it's the one toggle here that can silently invert your whole result depending on how your source images are encoded.

You don't know why this node exists. Fair - it's not solving a lighting problem, it's solving a "I have 2D relights and want rough 3D surface info without a depth/normal model" problem. If you just want a normal map from a single photo, ControlNet's normal-map preprocessors are the more direct tool; this node is specifically for people already deep in an IC-Light batch who want to squeeze extra geometric information out of what they've already generated.

CategoryIC-Light

Inputs (4)

NameTypeDefaultDescription
imagesIMAGE
sigmaFLOAT10.000.01–100
center_input_rangeBOOLEANfalse
maskoptMASK

Outputs (2)

NameTypeDescription
normalIMAGE
dividedIMAGE