comfyui_pcg docs

Brick wall PBR#

A complete tileable brick-wall texture set made only with COP (image) nodes: 2048 x 2048, seamless on all four sides. It outputs albedo, normal, roughness, height and AO maps, plus a lit 2 x 2 preview to check the seams.

Load it#

Drag example_workflows/pcg_cop_brick_material.json onto the ComfyUI canvas and press Queue. Only comfyui_pcg nodes plus ComfyUI's Preview Image and Save Image are used. The maps are saved as pcg/brick_albedo, pcg/brick_normal, pcg/brick_roughness, pcg/brick_height and pcg/brick_ao in ComfyUI's output folder.

Step by step#

1. Noise

  1. COP Noise (PCG) (2048 x 2048, Perlin, standard fractal, frequency 8, 6 octaves) writes the layer detail: brick-face relief and stains.
  2. COP Noise Extra (PCG) (kind crystal, frequency 48) adds the layer pits, used for cracks.
  3. Both noises repeat in u only; COP Retile (PCG) in seamless mode cross-fades detail and pits so they become seamless in both directions.

2. Bricks and height

  1. COP Pattern (PCG) (Tile Pattern, 4 x 10 bricks, offset 0.5, gap 0.018, bevel 0.12) adds the bricks and its helper layers: pattern_rand (a random value per brick), pattern_edge (pixel distance to the brick edge) and pattern_height (the bevel).
  2. A COP Wrangle (PCG) combines them into height. The edge distance is perturbed by the noise and thresholded, so brick edges and corners look chipped (@brick). The crystal noise boundaries (pits near 0) become cracks, and the mortar sits low.

3. Derived maps

  1. COP Height to Normal (PCG) (N), COP Height to AO (PCG) (ao) and COP Curvature (PCG) (curvature) are computed from height, all with Tile on: the borders are sampled periodically, so there is no seam.
  2. A second COP Wrangle (PCG) picks a brick colour from pattern_rand (about one brick in ten is a dark, over-fired one), brightens convex edges using curvature, multiplies by AO into albedo, and writes roughness (mortar rougher than brick).

4. Check and save

  1. COP Light (PCG) lights the albedo with the normal map and the height (with shadows) into lit; COP Tile (PCG) repeats it 2 x 2 to check for seams, shown by Preview Image.
  2. Each map on the right goes through its own COP Export (PCG) into a Save Image. The normal is exported with mode signed (-1..1 to 0..1).

Worth tweaking#

NodeParameterEffect
COP Patterncounts, offset, gap, bevel, rand_seedBrick layout, mortar width and bevel.
Height WranglecodeHow chipped the edges are (the smoothstep(1.5, 6.0, ...) and the * 18), crack depth, mortar depth.
Albedo WranglecodeBrick and mortar colours, the share of dark bricks (r > 0.88).
Height to Normal / AO / CurvaturestrengthBump strength of the derived maps.
COP Noisefrequency, rand_seedScale and layout of stains and relief.

See also#