Mask Blender (Tensor Prism)
Combine merge masks with math instead of guesswork
- mask_A
- mask_B
- combined_mask
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 byblend_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 Filter → Mask Blender → Weighted 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| mask_A | MASK | — | |
| mask_B | MASK | — | |
| blend_mode | COMBO | Linear Blend | 6 options: Add, Multiply, Max, Min, Linear Blend, Exponential Blend |
| memory_limit_gb | FLOAT | 2.00.5–16 | — |
| blend_strengthopt | FLOAT | 0.500–1 | — |
| clip_outputopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| combined_mask | MASK | — |