Apex Depth to Normal
Turn your depth map into a relightable normal map
- depth_map
- normal_map
- info
If you've got a depth map sitting in your graph - from Depth Anything, MiDaS, or any of the controlnet_aux preprocessors - Apex Depth to Normal converts it into a normal map, the thing that actually drives relighting and 3D-flavored effects. A depth map tells you how far things are; a normal map tells you which way each surface faces. For relighting (IC-Light-style workflows), parallax, or game/texture work, normals are the useful format. This node is a two-second GPU conversion that does the derivative math for you.
The math is the boring, reliable part: it grabs your depth map, converts it to grayscale if needed, then runs a 3×3 Sobel operator to get horizontal and vertical gradients. Those gradients become the X and Y of each surface normal, a Z component is derived from the gradient magnitude, and the whole vector gets normalized and packed into an RGB image where red is X slope, green is Y slope, and blue is "facing the camera." That's the same depth→normal pipeline described in the depth-estimation literature, just in a torch conv instead of a Photoshop filter.
The inputs that matter
- depth_map (IMAGE) - whatever your Depth Anything v2 or MiDaS preprocessor spat out. Single channel or RGB both work.
- strength (default 12, 0.1–30) - scales the gradients. Crank it up for punchier surface detail; the default is honestly fine for most depth sources.
The four optional inputs are where this node earns its keep:
- auto_invert_depth - the classic gotcha. Depth estimators disagree on which way is up: some emit white=close, others white=far. An inverted depth map gives you normals that look carved instead of embossed, and you'll chase it for twenty minutes before realizing. This flag samples the center vs. the edges of the map and flips it automatically if the center is significantly darker.
- invert - the manual version when you already know the convention is wrong.
- blur (0–3) - pre-smooths the depth map, which kills the speckle noise that cheap estimators put in flat surfaces.
- enhance_details (0–3) - histogram-stretches the depth first, pulling more range out of a flat-looking map.
Outputs are normal_map (IMAGE) and info (STRING) - the info string just tells you what it did, handy if auto-invert kicked in.
Where it goes in a workflow
Typical chain: Load Image → Depth Anything v2 preprocessor → this node → some relighting node (IC-Light and friends expect a normal map as conditioning) or a Blender/parallax export. It's a preprocessing step, not an output node - wire the normal_map forward, don't stare at it.
Installing it
It's part of the Apex Artist pack, so install the whole thing once. Easiest is ComfyUI Manager → search "Apex Artist" → Install. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ApexArtist/comfyui-apex-artist.git
Then restart ComfyUI. Good news: there are no model downloads and no heavy dependencies. The pack's requirements file is explicit that everything it needs (torch, numpy, Pillow) is already provided by ComfyUI. This is a small, low-profile MIT pack with basically zero community footprint - not a bad thing here, since you can read the whole source in a few minutes. Given the ecosystem's malware history, a pack this transparent is about the safest kind to install.
Gotchas
DepthAnything v2 Large is the recommended depth source per the KB - it's the best quality-per-second of the bunch. If your normals look inverted, try auto_invert before you touch anything else. And don't expect magic: normal maps computed from depth are only as good as the depth, so a mushy MiDaS output yields mushy normals. The node's own blur input helps a little; a better depth model helps more.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| depth_map | IMAGE | — | |
| strength | FLOAT | 12.00.1–30 | — |
| invertopt | BOOLEAN | false | — |
| auto_invert_depthopt | BOOLEAN | false | — |
| bluropt | FLOAT | 0.00–3 | — |
| enhance_detailsopt | FLOAT | 0.00–3 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| normal_map | IMAGE | — |
| info | STRING | — |