遮罩合并(列表)
Union-combine any number of masks into one region for a single inpaint pass
- 遮罩
- 合并遮罩
This is the mask-combining node you'll actually reach for. Where MaskConcatenate (same pack) stitches masks onto one canvas, MaskMergeList unions them - every white pixel from any input mask shows up in the output, overlaps become one solid region. The classic use: you have a face mask, a hands mask, and a torso mask from three separate detectors, and you want the detailer or inpaint pass to treat the whole person as one region. Feed them all in, get one mask out.
The input is the interesting part: the 遮罩 socket is multiple, meaning you can connect several mask sources to it directly in the UI - no list-into-single-socket gymnastics. The merge itself is a pixel-wise OR (technically max) across the masks, so soft edges and partial overlaps just stack up. Output is one MASK, 合并遮罩.
Two toggles handle the "but my masks are different sizes" problem, and the code refuses to let you have both on:
- 匹配尺寸最大 - resize everything up to the largest mask's dimensions.
- 匹配尺寸最小 - resize everything down to the smallest.
If the masks differ in size and neither toggle is on, the node errors out rather than guess. That's the right behavior, honestly - silent stretching is how seams appear. Also worth knowing: a single input mask passes through untouched, and if nothing is connected it returns a blank 512×512 mask instead of crashing, which keeps the graph from exploding during setup.
The KB's masking-and-detailing material makes the case for this kind of node nicely: the re-render is only as good as the mask, and combining regions before the inpaint pass beats running four separate inpaints with seams at the boundaries. If your workflow needs overlapping regions handled differently, this is also the node to read - it's the documented contrast to a stitch-type concatenate.
Install
ComfyUI Manager → search "muye" → install "ComfyUI-Muye-nodes", restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/muyexiuluo/ComfyUI-Muye-nodes
cd ComfyUI-Muye-nodes
pip install -r requirements.txt
then restart. Pure torch - no extra deps. The README's manual block references an older ComfyUI_Muye.git URL; use the -nodes one above.
Common issues
If you see an error about mismatched mask dimensions, that's the two-toggles rule doing its job - flip on 匹配尺寸最大 or 匹配尺寸最小 and re-run. Remember the labels are Chinese by design (display name 遮罩合并(列表), 匹配尺寸最大/最小 are the size-matching toggles). And if the node never appears, check the console for [Muye] Failed to load module - the pack silently drops any module that fails to import.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| 遮罩 | MASK | — | |
| 匹配尺寸最大 | BOOLEAN | false | — |
| 匹配尺寸最小 | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 合并遮罩 | MASK | — |