Nodes/ComfyUI-tbox/MaskAddNode
ComfyUI Node

MaskAddNode

Union up to seven masks into one

By er1cw00·Created 2 years ago·Updated about a year ago· 26
MaskAddNode
  • mask
  • src1
  • src2
  • src3
  • src4
  • src5
  • src6
  • MASK

When you've got several masks floating around a workflow - a hand mask here, a face mask there, maybe a manually painted region - and you need them treated as one combined selection, this is the node that merges them. It's addition, which in mask terms means union: the final mask covers everywhere any of your input masks covered, not just the overlap.

How it works

You wire a base mask into mask, then add up to six more into the optional src1 through src6 slots. Each additional mask you connect grows the selected area rather than narrowing it - this is a union operation, not an intersection, so connecting more masks always means more gets selected, never less. Overlapping regions between two connected masks don't get "extra selected" either; addition on mask values is the standard way to combine selections without double-counting overlaps.

Order doesn't matter here the way it would with a layered composite - since it's addition, connecting src1 before src2 versus the reverse produces the same result.

The inputs and outputs that matter

  • mask (required MASK) - your base selection.
  • src1 through src6 (all optional MASK) - additional masks to fold in. You don't need to fill all six; connect only as many as you actually have. Leaving the rest empty is completely normal, not a partial or broken setup.

Output: MASK - the combined result, ready to wire into a KSampler's mask input, an inpaint node, or a compositing step.

How to install it

Via ComfyUI Manager: search ComfyUI-tbox, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ai-shizuka/ComfyUI-tbox

then restart. No models or heavy dependencies here - it's pure tensor math on masks you already have, nothing to download.

Common issues & troubleshooting

Result mask is almost entirely white. Check whether your source masks are already broad - this node only ever grows the selected area, it never subtracts or narrows it. If one of your inputs already covers most of the image, adding more masks on top won't shrink that.

You wanted the overlap between two masks, not the combined area. This node does union (addition), not intersection. If what you actually need is "only where these masks agree," this isn't the right node - look for a multiply-style mask combiner elsewhere in your installed packs instead.

Only some of the six optional slots are connected and you're not sure that's valid. It is - src1 through src6 are all independently optional. A workflow using just mask and src1 is a perfectly normal use of this node, not a half-finished one.

Your ComfyUI canvas stopped floating, or scroll-wheel zoom broke, after installing this pack. Not this node's doing - it's a known conflict between one of tbox's own image-loading nodes and ComfyUI's frontend, documented on the pack's GitHub issues and cross-referenced against a core ComfyUI issue. Worth ruling out if your canvas got weird right after adding tbox, unrelated to whatever else you were troubleshooting.

Categorytbox/Mask

Inputs (7)

NameTypeDefaultDescription
maskMASK
src1optMASK
src2optMASK
src3optMASK
src4optMASK
src5optMASK
src6optMASK

Outputs (1)

NameTypeDescription
MASKMASK