Pixelwise(MASK + MASK)
Merge two masks into one
- mask1
- mask2
- MASK
In the node picker this shows up as Pixelwise(MASK + MASK), and that name is the whole spec: it adds two masks together, pixel by pixel, so you get the union of both. Anywhere either mask is white, the result is white. It's the simplest way to say "I want to affect this region and that region, together, as one mask."
You reach for it when your area of interest doesn't come from a single detector or a single hand-drawn shape. Painted a rough mask over a face and want to also include the neck you drew separately? Add them. Have a hand mask from one detection pass and a mask from another? Combine them into one before feeding a detailer or an inpaint.
How it works
Masks in ComfyUI are grayscale, white meaning "included" and black "excluded," with grays as partial values. This node does straightforward pixelwise addition of mask1 and mask2, clamped so it can't exceed full white. Where either mask has coverage, the sum keeps or exceeds that coverage; where neither does, the result stays black. No feathering, no threshold - just addition.
The inputs and outputs that matter
Two required inputs, no settings to tune:
mask1,mask2- the two masks to combine. Order doesn't matter here, unlike subtraction - addition is symmetric.
The single output is MASK, ready to feed a detailer, an inpaint node, or another mask operation downstream.
How to install it
Ships with the Impact Pack. ComfyUI Manager: search ComfyUI Impact Pack, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack comfyui-impact-pack
cd comfyui-impact-pack
pip install -r requirements.txt
then restart. No models or extra dependencies for this one - it's pure array math.
Common issues & troubleshooting
The combined mask covers more than expected. That's addition doing exactly its job - the result is the union, so if either input mask is looser than you thought, the sum inherits that looseness. Check each mask individually before combining if the result looks too broad.
Result looks washed out instead of solid white. If your masks have partial (gray) values rather than pure binary, adding two grays can land somewhere odd rather than a clean union. For most detailing and inpainting work you want binary masks going in - run through ToBinaryMask first if your source masks have soft edges you don't want compounding.
Sizes don't match. Both masks need to be the same resolution; resize one to match the other upstream if they came from different sources (say, one from a detector's native crop size and one hand-painted at full resolution).
You wanted the overlap, not the union. This node combines. If you actually want only the area where both masks agree, that's BitwiseAndMask - Pixelwise(MASK & MASK) - the AND version, not this one.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mask1 | MASK | — | |
| mask2 | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |