Nodes/ComfyUI-TextureAlchemy/Edge Wear Mask Generator
ComfyUI Node

Edge Wear Mask Generator

Wear masks without the tedium

By amtarr·Created 9 months ago·Updated 4 months ago· 58
Edge Wear Mask Generator
  • normal_map
  • curvature_map
  • ao_map
  • mask
width512
height512
edge_width0.10
edge_sharpness2.0
noise_scale10
noise_strength0.30
seed0

Nothing sells a material like wear. A pristine texture reads as a 3D mockup; one with chipped edges and scratched corners reads as something that's actually been through the world. Hand-painting that wear is misery, which is why this node exists: Edge Wear Mask Generator produces a believable edge-wear mask from geometry maps - or from nothing at all - in a single pass.

The output is a grayscale mask where the "worn" areas are bright, ready to drive a weathering blend in the pack's Multi-Texture Blender or a wear generator. The classic use: mask out the edges of a painted surface so the metal shows through.

How it works

It builds the wear pattern from whatever geometry you give it, in priority order:

  1. curvature_map - if you feed it a curvature map (edges and crevices are bright), it uses that directly as the wear base. This is the most accurate path: curvature literally means "where the surface folds," and folds are where paint chips.
  2. normal_map - no curvature? It derives an edge signal from the normal map on the fly.
  3. nothing - with neither connected, it generates a procedural distance-based edge pattern (wear concentrated toward the borders of the texture), which is surprisingly useful for tile borders.

On top of the base, it adds noise (noise_strength, default 0.3) so the wear edge isn't a clean ruler line - real chipping is ragged. Then edge_width and edge_sharpness shape the falloff, and an optional ao_map modulates the result so wear also collects in crevices (via the pack's AO Approximator, for instance).

The inputs

  • width / height - output resolution.
  • edge_width (0.01–0.5, default 0.1) - how far wear extends inward.
  • edge_sharpness (0.1–10, default 2) - higher = crisper chip line, lower = softer gradient.
  • noise_scale / noise_strength / seed - the raggedness and its randomness.
  • Optional: normal_map, curvature_map, ao_map.

Output: a single mask IMAGE.

Tips and traps

The workflow the pack recommends is Curvature Generator → Edge Wear → Weathering, with AO added for crevice dirt. For the best quality, feed both a curvature map and an AO map; the difference between "edge only" and "edge + crevice" wear is what separates a good prop from a great one. The trap is cranking edge_width - 0.1 is already a chunky chip zone, and 0.3+ starts eating the whole surface. Start at the defaults, look at the mask, then tune.

Installation

Part of amtarr/ComfyUI-TextureAlchemy, under Add Node → Texture Alchemist → Masks. Install via ComfyUI Manager (search "TextureAlchemy") or:

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

Restart ComfyUI. No dependencies, no models - pure procedural torch.

CategoryTexture Alchemist/Masks

Inputs (10)

NameTypeDefaultDescription
widthINT51264–8192
heightINT51264–8192
edge_widthFLOAT0.100.01–0.5Width of edge wear (0.0-1.0)
edge_sharpnessFLOAT2.00.1–10Edge falloff sharpness
noise_scaleFLOAT101–100Variation noise scale
noise_strengthFLOAT0.300–1Amount of edge variation
seedINT00–18446744073709550000
normal_mapoptIMAGE
curvature_mapoptIMAGE
ao_mapoptIMAGE

Outputs (1)

NameTypeDescription
maskIMAGE