Nodes/ComfyUI Body Decal/Body Decal Mask Combine
ComfyUI Node

Body Decal Mask Combine

The two-mask combinator that actually knows which side is which

By verias·Created 3 months ago·Updated 3 months ago· 1
Body Decal Mask Combine
  • mask_a
  • mask_b
  • mask
mode

Body Decal Mask Combine is a straightforward utility: take two masks, combine them with one of five operations, and get one mask out. In the body-decal context it's usually doing something like intersecting a placement region with a color-range mask ("only where the skin is, and only inside the forearm region") or cutting a region out of another mask. But it's not tied to decals at all - if you've got two masks and need them combined, this works anywhere.

How it works

Five modes, all applied per-pixel, all self-explanatory:

  • multiply - the intersection. Both masks must be bright for the result to be bright.
  • add - the union, clipped to 1.0. Wherever either mask is bright, the result is bright.
  • subtract - mask_a minus mask_b. Knock a hole in one mask with the other.
  • max - take the brighter of the two at every pixel (a soft union).
  • min - take the darker (a soft intersection).

The one implementation detail worth knowing: it always operates on the first frame of each mask (mask_a[0], mask_b[0]), and if the two masks differ in resolution, mask_b gets resized to match mask_a with bilinear resampling. So feed it the mask you care about most as mask_a - its size wins.

Where it fits

A common chain: Body Decal Region's region_mask goes into mask_a, a Color Range Mask (skin detection, say) goes into mask_b, and multiply produces a mask that's "the forearm region, but only actual skin." That refined mask can then feed Body Decal Apply's clip_mask or user_region_mask, or Body Decal Surface Warp's region_mask, keeping the decal off areas the pose geometry covers but shouldn't.

The example workflow in the repo does exactly this pattern, combining a region-ish mask with a color-range mask before feeding the decal apply step.

Gotchas

None of the drama of the bigger nodes - just remember the output is a single MASK and that subtract is directional (mask_a − mask_b, not the other way). If your combined mask looks like only one input took effect, check the resolutions: a tiny mask resized up to a big one is going to look soft, so doing resolution math upstream saves you a confusing result. It's a image/masking/body decal category node, installed with the rest of the pack via Manager search "ComfyUI Body Decal" or cloning https://github.com/verias/comfyui-body-decal.git into ComfyUI/custom_nodes.

Categoryimage/masking/body decal

Inputs (3)

NameTypeDefaultDescription
mask_aMASK
mask_bMASK
modeCOMBO5 options: multiply, add, subtract, max, min

Outputs (1)

NameTypeDescription
maskMASK