Nodes/Eden.art nodesuite/Eden_MaskCombiner
ComfyUI Node Runs on cloud

Eden_MaskCombiner

Blend up to three masks with weights, gamma, and soft clamping β€” the compositor for masks

By edenartlabΒ·Created 3 years agoΒ·Updated 6 months agoΒ· 119
Eden_MaskCombiner
  • mask_a
  • mask_b
  • mask_c
  • MASK
β—„rel_strength_a0.50β–Ί
β—„rel_strength_b0.00β–Ί
β—„rel_strength_c0.00β–Ί
β—„lower_clamp2.0β–Ί
β—„upper_clamp98.0β–Ί
β—„gamma0.70β–Ί

Eden_MaskCombiner takes up to three masks and merges them into one, with real control over how they interact. This is the node for "I want the face mask AND the hand mask, but mostly the face, and I want the edges soft" - the kind of thing that's painful with basic add/subtract mask nodes and easy here.

How it works

The merge is a weighted, normalized blend with a few tasteful touches. Each mask is gamma-corrected first (gamma, default 0.7 - darkens the midtones and lifts shadows, which changes how edges blend). Each has a relative strength (rel_strength_a/b/c) from βˆ’1 to 1: positive strengths include the mask, negative strengths invert it (so a negative strength is "everywhere except this region"). The strengths go through a softmax, so the output is a properly weighted average rather than a sum that can blow past 1.

Then the blend gets clamped - but softly. lower_clamp (default 2) and upper_clamp (default 98) are percentiles: the node finds the 2nd and 98th percentile of the combined values and applies a sigmoid-based soft clamp between them. The practical effect is that the result keeps a clean range instead of piling up hot whites and dead blacks. Finally an inverse gamma brings it back.

Inputs that matter

  • mask_a (MASK) - the always-required base mask.
  • mask_b / mask_c (MASK, optional) - add up to two more.
  • rel_strength_a/b/c - blend weights; negative inverts that mask's contribution.
  • lower_clamp / upper_clamp (percentiles, 0–50 / 50–100) - the soft-clamp range.
  • gamma (0.1–2) - per-mask tonal shaping before blending.

Output: a single MASK.

Why you'd reach for it

Regional conditioning is the headline use. Inpainting with a combined mask ("hair and eyes, but not the skin between them") is the obvious one, and it's the standard trick for building a mask that covers several disjoint regions that a single segmentation node won't give you. The negative-strength inversion is genuinely useful - "everything except X" masks are awkward to build otherwise. And the soft clamp keeps the result sampler-friendly; a raw sum of masks frequently needs manual normalization, and this node handles that for you.

Installing it

Part of the Eden.art nodesuite (edenartlab/eden_comfy_pipelines). Install via ComfyUI Manager (search "Eden.art nodesuite") or:

cd ComfyUI/custom_nodes
git clone https://github.com/edenartlab/eden_comfy_pipelines
cd eden_comfy_pipelines && pip install -r requirements.txt

Restart ComfyUI.

Common issues

The percentiles are subtle and easy to misfire: with lower_clamp at 0 and upper_clamp at 100 there's effectively no clamping, which undoes the point of the node. Keep the defaults until you have a reason to move them. Also note rel_strength_* of exactly 0 drops that mask from the blend entirely - so if mask_b "does nothing," check you didn't leave its strength at the 0 default while expecting it included. mask_a has no such default trap; its strength defaults to 0.5.

CategoryEden 🌱

Inputs (9)

NameTypeDefaultDescription
mask_aMASKβ€”
rel_strength_aFLOAT0.50-1–1β€”
rel_strength_bFLOAT0.00-1–1β€”
rel_strength_cFLOAT0.00-1–1β€”
lower_clampFLOAT2.00–50β€”
upper_clampFLOAT98.050–100β€”
gammaFLOAT0.700.1–2β€”
mask_boptMASKβ€”
mask_coptMASKβ€”

Outputs (1)

NameTypeDescription
MASKMASKβ€”