Nodes/ComfyUI-TextureAlchemy/Normal to Depth Converter
ComfyUI Node

Normal to Depth Converter

Turning Normal Maps Back Into Height (For Displacement, Parallax, 3D Print)

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Normal to Depth Converter
  • normal
  • depth
methodhybrid
strength1.00
iterations50
blur_radius1.0

Depth and normal maps are two ways of saying the same thing, and half the time you'll end up with one when you needed the other. Your depth model gives you a clean height map but your renderer wants normals - or your normal map is gorgeous but your displacement modifier needs a height field. Normal to Depth Converter does the reverse trip: reconstruct a grayscale height/depth map from a normal map, right in the TextureAlchemy pack.

This matters more than it sounds. Normal maps are cheap to generate and easy to layer, but a lot of downstream stuff only takes height: displacement, parallax occlusion, 3D printing, height-blended detail. The README's own pitch is "convert normal maps to height/depth maps," and it slots neatly into the pipeline as the step that turns your normal pass into something a 3D tool can actually consume.

How it works

Three methods, with a real speed/quality tradeoff:

  • integration - the accurate one. It treats the red channel as the X gradient and the green as the Y gradient of the surface, then iteratively integrates them (a Jacobi-style solve, iterations controls how many passes) to reconstruct the height field. Slow, especially at high resolution, but geometrically honest.
  • blue_channel - the cheat code. The blue channel of a normal map is roughly proportional to surface facing (flatter = brighter), so it just grabs that as a depth approximation. Nearly instant, but it's a ballpark, not a reconstruction - real geometry gets smeared.
  • hybrid (default) - blends the two: about 30% blue-channel approximation with 70% integrated depth. The README's recommendation, and the right default for "I just want a usable height map."

After reconstruction it normalizes to the 0-1 range, applies strength as a multiplier, and smooths with blur_radius if you want the result less noisy.

Inputs that matter

  • normal - the map to convert. Needs red+green channels; if you feed a single-channel image, the integration path just falls back to zeros for gradients.
  • method - start on hybrid.
  • iterations (1-200) - only affects the integration path. More is more accurate and slower; 50 is the default and usually enough.
  • strength (0-5) - how much depth to give the result.
  • blur_radius (0-10) - smoothing. A little goes a long way on noisy normal maps.

The single output is depth, a 3-channel grayscale image that feeds straight into the height slot of a PBR Combiner, a displacement node, or the PBRHeightProcessor if you want to normalize or invert it on the way.

Installing it

Same pack, same story:

cd ComfyUI/custom_nodes
git clone https://github.com/amtarr/ComfyUI-TextureAlchemy

or grab it through ComfyUI Manager, then restart. Look under Texture Alchemist → Normal. No models, no pip installs.

Gotchas

The integration method is CPU-heavy - the README flags it as "CPU-intensive" and it's the one place in this pack where I'd actually wait on a big image. If a 4K normal map is crawling, drop to hybrid or dial iterations down. Second, blue_channel mode quietly produces a low-contrast approximation; don't use it for displacement you care about. And watch the format: if your normal map is DirectX-flipped, you'll get an inverted-looking depth - run it through the pack's format converter (or flip the green channel) first. For the reverse direction - height back to normals - the pack has a Height to Normal converter elsewhere in the suite.

CategoryTexture Alchemist/Normal

Inputs (5)

NameTypeDefaultDescription
normalIMAGE
methodCOMBOhybridConversion method: integration (accurate), blue_channel (fast), hybrid (balanced)
strengthFLOAT1.000–5Depth strength multiplier
iterationsINT501–200Integration iterations (higher = more accurate but slower)
blur_radiusFLOAT1.00–10Smoothing blur radius

Outputs (1)

NameTypeDescription
depthIMAGE