LLS Mask Combine
Add, subtract, intersect, XOR — boolean math for masks
- mask_a
- mask_b
- mask
Masks are the quiet workhorse of local editing, and the moment you're doing anything real with them - keep this region, exclude that one, combine a geometric mask with a hand-drawn one - you need set operations. LLS Mask Combine is exactly that: two masks in, one mask out, with six logical modes.
The modes map to familiar boolean ideas:
add(ormax) - union. Anything white in either mask stays white.subtract- remove mask B's area from mask A.intersect(ormin) - keep only where both overlap.xor- keep only where exactly one of them is white. Great for "flip this region's state."
add is the default, and most real workflows live on add, subtract, and intersect - think "geometric rectangle minus the part where the hand-drawn mask already fixed it."
How it behaves
The node normalizes both masks and resizes B to match A's dimensions before combining, so you can wire in masks of different sizes without a resize node in between. Output is a single mask. It's a pure utility: no models, no sampling, nothing to break.
Where it fits
In the LLS pack, masks flow from LLS Simple Mask Create (geometric), LLS Simple Mask Draw (hand-painted), or anywhere else, into repair prep and save nodes. LLS Mask Combine sits in the middle of that flow when you need to stack or cut regions before they reach the repair chain. A common pattern: union a circle mask with a rectangle mask to cover an oddly-shaped area, then feed the result to a repair prepare node. This is the same territory as the Impact Pack's mask combos, just in a simpler one-input-per-operation shape.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/Gin3601/LLS-node
# restart ComfyUI
Or ComfyUI Manager → search "LLS-node". No dependencies beyond torch (which ComfyUI already provides) - this is a few lines of tensor math.
Honest take
There's nothing novel here; ComfyUI has other mask-combine nodes and the Impact Pack's equivalents are more feature-rich. What LLS Mask Combine gets right is simplicity and predictable naming inside a pack that already gives you the mask sources (Create, Draw) and the mask consumer (repair prep). If you're building an LLS-native repair workflow, this is the natural glue. If you just need to combine two masks in isolation, any equivalent works - the math is identical either way.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mask_a | MASK | — | |
| mask_b | MASK | — | |
| mode | COMBO | add | 6 options: add, subtract, intersect, xor, max, min |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |