Nodes/Tensor Prism/Mask Blender (Tensor Prism)
ComfyUI Node

Mask Blender (Tensor Prism)

Combine merge masks with math instead of guesswork

By Arctenox·Created 12 months ago·Updated 7 months ago· 2
Mask Blender (Tensor Prism)
  • mask_A
  • mask_B
  • combined_mask
blend_modeLinear Blend
memory_limit_gb2.0
blend_strength0.50
clip_outputtrue

Once you start masking merges, you rarely need one mask - you need "attention layers in the input blocks, but also the whole output region, but not the VAE." Combining those conditions by hand is where the pack's Mask Blender (Tensor Prism) comes in: it takes two MASKs and combines them with a real blend operation, so your merge conditions compose cleanly instead of colliding.

It's a small, honest utility: two masks in, one mask out, six blend modes. If you've built one mask with Model Mask Generator (structure-based) and one with Model Key Filter (anatomy-based), this is the node that welds them into a single thing Weighted Mask Merge can consume.

How it works

Wire in mask_A and mask_B, then pick blend_mode:

  • Add - sums the masks; union-ish. Use it when either mask should count.
  • Multiply - intersects; a weight only counts if both masks cover it. The way to say "attention AND in the input blocks."
  • Max - takes the stronger value at each position; like Add but clamped.
  • Min - takes the weaker value; the conservative option.
  • Linear Blend (default) - a weighted mix controlled by blend_strength (0.5). The all-purpose option.
  • Exponential Blend - a curved blend; good when you want the result to lean hard toward one mask.

Optional blend_strength applies to the linear blend, and clip_output (on) keeps the result clamped to the 0–1 range a mask expects. memory_limit_gb (default 2) bounds the memory the operation may use. The single output is combined_mask (MASK).

How to use it

The classic chain: Model Mask Generator → (optionally) Model Key FilterMask BlenderWeighted Mask Merge. Multiply is the mode you'll reach for most - it's how you narrow a region (attention, input blocks) down to the intersection you actually wanted. Add when you're widening, Multiply when you're narrowing.

Installing it

Part of ComfyUI-Tensor-Prism-Node-Pack. ComfyUI Manager → search "Tensor Prism" → Install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/AstrionX/ComfyUI-Tensor-Prism-Node-Pack

No model downloads; deps are torch, numpy, psutil. Skip the typo'd clone URL in the README.

The honest caveat

One real gotcha: the 1.7.1 changelog lists "Fixed Mask Blender" - so if you're on an older pack version and blend outputs look wrong, update first, don't debug. And like the rest of this pack (first-time author, "vibe-coded," zero community corpus), the six blend modes are standard math - Add/Multiply/Max/Min are exactly what they claim - so the node is trustworthy in the mechanics, just young in the ecosystem. If you're combining more than two masks, chain the node: feed the first blend's output into the next mask_A.

CategoryTensor_Prism/Mask

Inputs (6)

NameTypeDefaultDescription
mask_AMASK
mask_BMASK
blend_modeCOMBOLinear Blend6 options: Add, Multiply, Max, Min, Linear Blend, Exponential Blend
memory_limit_gbFLOAT2.00.5–16
blend_strengthoptFLOAT0.500–1
clip_outputoptBOOLEANtrue

Outputs (1)

NameTypeDescription
combined_maskMASK