ComfyUI Node

EmAySee Mask Union

Merge up to 14 masks into one — the union node that just works

By EmAySee·Created about a year ago·Updated 4 months ago· 2
EmAySee Mask Union
  • mask_1
  • mask_2
  • mask_3
  • mask_4
  • mask_5
  • mask_6
  • mask_7
  • mask_8
  • mask_9
  • mask_10
  • mask_11
  • mask_12
  • mask_13
  • mask_14
  • mask

EmAySee Mask Union is exactly what it says on the tin: up to 14 optional mask inputs in, one combined mask out. The combine is a logical union - white stays white anywhere at least one input was white, so the result is the total area covered by every mask you plugged in.

The everyday use is the "pile of segmentations" problem. You ran a face detector, a hand detector, and a background remover, or you built masks from three different ControlNet passes, and now you want one mask that says "regenerate all of this." Instead of chaining a bunch of combine nodes, you drop this in and patch all of them into the inputs. That's the whole job, and it does it without fuss - all fourteen ports are optional, so you only wire up what you have.

It slots into the standard masked-inpainting flow from this pack: build your regions, union them, then either overlay to inspect or feed straight into a masked sampler. It also composes with EmAySee_MaskSkinnier or EmAySee_MaskUniversalXY if you want to shape the combined result afterward.

How it works

The math is a per-pixel maximum. For each pixel, the output takes the brightest value across all input masks, so overlapping regions don't add up to a brighter or blown-out area - 0.5 + 0.5 stays 0.5, not 1.0. That matters for soft-edged masks: you keep the strongest edge wherever masks overlap, and nothing saturates.

Sizes are handled automatically. Every mask is resized up to the largest input's dimensions using bilinear interpolation, so mixing a 512×512 face mask with a 1024×1024 background mask just works, with the smaller one upscaled to fit. If you plug in nothing at all, it returns a 64×64 black mask instead of crashing - handy when a workflow has masks that come and go.

The inputs that matter

Honestly, there's one thing to know: the inputs are mask_1 through mask_14, all optional. Wire what you have, leave the rest dangling. There are no parameters to tune - no opacity, no blend mode, no feather. The single output is mask, and it's a plain MASK you route wherever a single combined mask is needed.

Installing it

Part of the EmAySee pack:

# ComfyUI Manager: search "ComfyUI_EmAySee_CustomNodes" and install
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes

Restart ComfyUI after installing. No extra dependencies - this node needs nothing beyond torch, and the pack ships no requirements.txt, so there's no pip step to worry about.

Common issues

Because the union uses max rather than addition, a common beginner confusion is expecting "both masks combined at full strength" to read as 1.0 everywhere - it does, so you're fine, but don't look for a separate brightness signal. The other thing to watch: upscaling small masks to match a large one means soft edges get softer. If one input mask is noisy, the noise lands in the union too, so clean your inputs before combining. And if two masks disagree at a boundary, max wins silently - that's the design, not a bug.

CategoryEmAySee/Mask

Inputs (14)

NameTypeDefaultDescription
mask_1optMASK
mask_2optMASK
mask_3optMASK
mask_4optMASK
mask_5optMASK
mask_6optMASK
mask_7optMASK
mask_8optMASK
mask_9optMASK
mask_10optMASK
mask_11optMASK
mask_12optMASK
mask_13optMASK
mask_14optMASK

Outputs (1)

NameTypeDescription
maskMASK