Nodes/ComfyUI-TextureAlchemy/Curvature Map Generator
ComfyUI Node

Curvature Map Generator

Turn a Normal Map Into a Wear Mask

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Curvature Map Generator
  • input_map
  • curvature
input_typenormal
strength1.0
blur_radius1.0

Here's the thing about real-world wear: it happens on edges. Corners get scuffed, raised details get scratched, crevices collect dirt. Curvature Map Generator is the node that finds those edges for you - it takes a normal or height map and produces a curvature map that highlights exactly the spots where wear and dirt belong. It's the difference between weathering a texture randomly and weathering it where a human eye expects it.

It sits in the Effects category of amtarr/ComfyUI-TextureAlchemy, right alongside the pack's wear-generation tooling. For a game-asset or arch-viz workflow, it's the secret sauce that makes procedurally-aged materials stop looking procedural.

How it works

Curvature is essentially the second derivative of the surface - where a surface bends, curvature spikes. The node computes that with a Laplacian convolution:

  • If input_type is normal, it uses the blue (Z) channel of the normal map - the one that encodes surface height - rather than the whole RGB mess.
  • If height, it converts to grayscale luminance first and runs the Laplacian on that.

The output is then run through strength, made absolute (so concave and convex both register), optionally blurred by blur_radius, and normalized to 0–1. White areas = high curvature = edges and crevices. Black = flat.

The inputs that matter

  • input_map - a normal map or height map. You can pull a normal straight from the pack's Lotus pipeline, or a height from the Marigold/Lotus depth output.
  • input_type - normal or height. Pick the one that matches what you plugged in; feeding it the wrong type gives you garbage because it's reading the wrong channel.
  • strength (0–10, default 1) - detection sensitivity. Low values only catch sharp edges; high values catch gentle bends too.
  • blur_radius (0–10, default 1) - smoothing. A bit of blur makes the mask read as soft wear instead of a crackling wireframe.

Output is a single curvature IMAGE - a grayscale mask you can wire into wear, blend, or color nodes.

Where it slots in

The canonical TextureAlchemy move: normal map → Curvature Generator → get an edge mask → use that mask to drive the pack's wear generator or to overlay dirt only in the cracks via Blend Mode Utility. You can also use it to enhance AO - edges and cavities from curvature, multiplied into an AO map, add believable contact detail. If you're building wear for an asset, this node is the reason the wear lands in the right place.

Installing it

Part of TextureAlchemy, one install covers it:

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

restart, and it's under Texture Alchemist → Effects. ComfyUI Manager: search "Texture Alchemy". No extra dependencies - it's a couple of convolutions on the GPU.

Gotchas

The most common mistake is leaving input_type at the default "normal" and feeding it a height map - the node silently reads the blue channel of your height data, which is basically a flat mid-gray, and you get a blank mask. Also, this is a local-edge detector, so it doesn't distinguish between a real feature edge and an artifact edge: if your normal map is noisy, the curvature mask will be noisy too. Blur your input first if that's happening. And expect to play with strength - the default 1.0 is a starting point, not a finish line.

CategoryTexture Alchemist/Effects

Inputs (4)

NameTypeDefaultDescription
input_mapIMAGE
input_typeCOMBOnormalType of input map
strengthFLOAT1.00–10Curvature detection strength
blur_radiusFLOAT1.00–10Smoothing radius

Outputs (1)

NameTypeDescription
curvatureIMAGE