Nodes/comfy_Pond_Nodes/🐳多遮罩合并
ComfyUI Node

🐳多遮罩合并

Merge up to eight masks into one, aligned and blended your way

By Pondowner857·Created about a year ago·Updated 21 days ago· 45
🐳多遮罩合并
  • 基准遮罩
  • 遮罩2
  • 遮罩3
  • 遮罩4
  • 遮罩5
  • 遮罩6
  • 遮罩7
  • 遮罩8
  • 合并遮罩
对齐方式居中对齐
合并模式相加模式
X轴偏移0
Y轴偏移0

A real human-body inpaint often needs a face mask and a hand mask and a torso mask merged into one region so a single pass fixes everything. That's the job 🐳多遮罩合并 (Mask Multi Align Merge) exists for: take a base mask plus up to seven more, align every one to the base, and fold them together with your choice of blend mode. It's the kitchen-sink version of the pack's simple two-mask merge, and it's the one you want when a workflow starts accumulating masks.

The key feature is the same alignment-first philosophy as the rest of the pack's mask nodes: each incoming mask is aligned to the base by its white-region bounds (nine alignment modes), so masks from different detectors or different resolutions actually line up instead of stacking on top of each other at mismatched offsets.

How it works

The base mask sets the anchor. Each additional mask (遮罩3 through 遮罩8) is shifted into place relative to the base, then merged into the running result with 合并模式:

  • 相加模式 (add) - values add, capped at 1. Overlaps stay solid white.
  • 最大值模式 (max) - take the brighter pixel at each spot.
  • 最小值模式 (min) - take the dimmer; effectively keeps only what all masks agree on.
  • 乘法模式 (multiply) - values multiply, a darkening combination.
  • 屏幕模式 (screen) - the "lighten" blend, 1 − (1−a)(1−b). Brightens overlaps and is great for stacking soft-edged masks without washing them out.

Optional X轴偏移 / Y轴偏移 apply a global nudge to the whole stack after alignment.

Inputs and output

  • 基准遮罩 (base mask) and 遮罩2 - required.
  • 对齐方式 - 9 modes, default 居中 (center).
  • 合并模式 - the five above, default 相加 (add).
  • Optional 遮罩3遮罩8 - up to six more.
  • Optional X轴偏移, Y轴偏移.

Output: 合并遮罩 (merged mask, MASK).

Practical tips: if you feed a four-frame batch of masks and only want the first, index it out first - the alignment math assumes you're working with single masks. And "add" is the safe default for binary masks; reach for "screen" when your masks are soft and you want to preserve their gradients.

Install

Standard Pond Nodes install:

ComfyUI Manager → search "Pond Nodes" (comfy_Pond_Nodes)

or:

cd ComfyUI/custom_nodes
git clone https://github.com/Pondowner857/comfy_Pond_Nodes
cd comfy_Pond_Nodes
pip install -r requirements.txt

Restart after. Torch and numpy cover it; no models to download. Pack footnote: the README documents a console-spam conflict with comfyui_HiDream-Sampler if you run both.

Category🐳Pond/mask

Inputs (12)

NameTypeDefaultDescription
基准遮罩MASK
遮罩2MASK
对齐方式COMBO居中对齐9 options: 居中对齐, 左对齐, 右对齐, 上对齐, 下对齐, 左上对齐, +3
合并模式COMBO相加模式5 options: 相加模式, 最大值模式, 最小值模式, 乘法模式, 屏幕模式
遮罩3optMASK
遮罩4optMASK
遮罩5optMASK
遮罩6optMASK
遮罩7optMASK
遮罩8optMASK
X轴偏移optINT0-2048–2048
Y轴偏移optINT0-2048–2048

Outputs (1)

NameTypeDescription
合并遮罩MASK