Masks Combine Regions
Merge several masks into one
Two or more masks in, one combined mask out. It's the union operation for masks - wherever any input mask is white, the output is white. The pack states it plainly: "combine 2 or more masks into one mask."
You end up needing this constantly once you're doing anything with more than one masked region. You segmented a person and a bag separately and want to inpaint both. You built three rectangular regions and want them treated as one selection. You've got a face mask and a hand mask and want a single "detail these" mask. Combine Regions welds them together.
Why you'd reach for it
Masking pipelines tend to produce masks piecemeal. SAM gives you one object at a time. Rectangle nodes give you one box at a time. Threshold and region nodes isolate one blob. But the sampler wants a single mask telling it everywhere to work. Combine Regions is the merge step that turns a pile of individual selections into the one mask your inpaint pass actually consumes.
It also opens up compositional masking: build masks with completely different tools - a SAM object here, a hand-painted region there, a thresholded area from a depth map - and OR them into one coherent selection. Each source does what it's best at; Combine Regions assembles the result.
How it works
It takes multiple mask inputs and merges them by taking the maximum at each pixel - the union. A pixel that's white in any input is white in the output; a pixel that's black in all of them stays black. Simple, predictable, order-independent. (If you need subtraction - remove one mask from another - or addition with different math, WAS has separate Mask Subtract and Mask Add nodes; this one is the straight combine.)
The inputs and outputs that matter
- two or more MASK inputs - the masks you want merged. Wire in the regions you've built.
The output is a single MASK representing the union of them all. It flows into a Set Latent Noise Mask, an inpaint encode, or further mask ops (dilate, blur, crop) before you use it.
Installing it
Comes with WAS Node Suite. ComfyUI Manager: search WAS Node Suite, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui
install requirements.txt against your ComfyUI Python, restart.
Common issues
The combined mask is bigger than expected / regions bled together. That's the union working as designed - overlapping or adjacent masks merge into one continuous region. If you wanted them kept separate, don't combine them; process each mask independently instead.
One input mask isn't showing up in the result. Check it actually has white pixels - an empty or all-black mask contributes nothing to a union. Preview each input before combining.
Sizes don't match. Masks being combined should describe the same canvas. If one mask is a different resolution than the others, resize it to match first, or you'll get misaligned or truncated results.
Node's gone after a ComfyUI update. Pack-level, not this node. WAS Node Suite is retired and no longer maintained; its dependency pins clash with ComfyUI updates and throw "Import Failed," which pulls every WAS node offline until you reinstall the pack's requirements.txt against the correct ComfyUI environment.
Straightforward node, no models, no VRAM, nothing to tune. It's one of a whole family of WAS mask utilities (Add, Subtract, Combine Batch, Dominant/Minority Region, Fill, Smooth) - reach for Combine Regions specifically when you have several distinct masks and want them treated as one.
Inputs (0)
No inputs
Outputs (0)
No outputs