Nodes/ComfyUI Minecraft PBR/Minecraft PBR - Pack Metal Masks
ComfyUI Node

Minecraft PBR - Pack Metal Masks

Per-pixel metal ids without the guesswork

By jasonjgardner·Created 3 months ago·Updated 3 months ago· 0
Minecraft PBR - Pack Metal Masks
  • custom
  • iron
  • gold
  • aluminum
  • chrome
  • copper
  • lead
  • platinum
  • silver
  • metal_mask
threshold0.50

Most textures are one material. But what about a copper face with a chrome border, or an iron door with brass trim? A single metalness value can't describe that - the shader needs to know which metal each pixel is. That's what Minecraft PBR - Pack Metal Masks is for. It composites several region masks into one metal-id map that the labPBR packer uses to stamp each metal's exact identity into the specular green channel.

How it works

labPBR encodes metal identity in the _s texture's green (F0) channel using fixed byte values. This node knows the whole table: iron 230, gold 231, aluminum 232, chrome 233, copper 234, lead 235, platinum 236, silver 237, and custom 255. You paint a separate region mask for each metal you need - say, a copper mask covering the face and a chrome mask over the trim - and the node thresholds each one and stacks them into a single normalized id map.

The output is a metal_mask IMAGE (the id replicated across RGB, so the discrete byte survives the packer's luminance collapse intact). Wire it into Pack labPBR's metal_mask input and every painted pixel gets that metal's exact id, overriding both the hardcoded_metal combo and the metalness threshold. Unpainted pixels fall back to normal behavior.

Two details worth knowing:

  • threshold (default 0.5) decides how strong a mask value must be before a pixel counts as that metal. Values are never blended - interpolating between two metal ids would produce a meaningless third id, so each pixel snaps to one metal.
  • Overlaps resolve last-wins, and the order is deliberate: named metals paint over custom. Paint your custom region first, then the named metals, and the named ones win wherever they conflict.

Inputs that matter

Nine optional region masks - custom, iron, gold, aluminum, chrome, copper, lead, platinum, silver - each taking an IMAGE or MASK, plus the shared threshold. You only connect the metals you actually use.

Install

ComfyUI Manager → Install Custom Nodes → search "comfy-ui-minecraft-pbr", install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/jasonjgardner/comfy-ui-minecraft-pbr
# then restart ComfyUI

No models, no extra dependencies.

Gotchas

Connect at least one region mask or the node errors out with "connect at least one metal region mask" - fair enough, since an empty map is meaningless. And step back before you reach for it: if your whole surface is a single metal, you don't need this node at all - just set hardcoded_metal on the packer and move on. Multi-metal packing is genuinely fiddly, so only pull it out when a surface actually mixes metals. It's also worth knowing that soft-edged mask borders get snapped hard by the threshold, so if you want a clean metal transition, the mask itself has to carry the edge.

CategoryMinecraft PBR

Inputs (10)

NameTypeDefaultDescription
thresholdFLOAT0.500–1Mask value above which a pixel is assigned that metal id.
customoptIMAGE,MASKRegion that is custom (labPBR specular-green id 255).
ironoptIMAGE,MASKRegion that is iron (labPBR specular-green id 230).
goldoptIMAGE,MASKRegion that is gold (labPBR specular-green id 231).
aluminumoptIMAGE,MASKRegion that is aluminum (labPBR specular-green id 232).
chromeoptIMAGE,MASKRegion that is chrome (labPBR specular-green id 233).
copperoptIMAGE,MASKRegion that is copper (labPBR specular-green id 234).
leadoptIMAGE,MASKRegion that is lead (labPBR specular-green id 235).
platinumoptIMAGE,MASKRegion that is platinum (labPBR specular-green id 236).
silveroptIMAGE,MASKRegion that is silver (labPBR specular-green id 237).

Outputs (1)

NameTypeDescription
metal_maskIMAGE