Nodes/Tensor Prism/Weighted Mask Merge (Tensor Prism)
ComfyUI Node

Weighted Mask Merge (Tensor Prism)

The node where masks actually meet the models

By Arctenox·Created 12 months ago·Updated 7 months ago· 2
Weighted Mask Merge (Tensor Prism)
  • model_A
  • model_B
  • mask
  • merged_model
merge_ratio1.00

Every mask in this pack - from Model Mask Generator, Model Key Filter, Mask Blender - is just a picture of intent until something applies it. Weighted Mask Merge (Tensor Prism) is that something: it's the single node that takes two models and a mask and actually performs a merge where the mask controls, weight by weight, which parent wins. Everything else in the mask system funnels into this node.

It's also the simplest node in the whole pack, which is exactly why it's trustworthy. Four inputs, one output, no memory-management dials, no exotic options. If you understand that a MASK is a 0-to-1 map over the weights, you understand this node completely.

How it works

Three required inputs:

  • model_A - the base model.
  • model_B - the model being blended in.
  • mask (MASK) - the 0-to-1 map. Where the mask is 0, A wins; where it's 1, B wins; in between, they blend by the mask value.

One control: merge_ratio (default 1, range 0–2). This is the intensity of the whole mask-driven blend - 1.0 applies the mask at full strength, values below 1 soften the mask's effect toward a plain even blend, and above 1 pushes it past the mask's own values. So you can build one mask and sweep merge_ratio like a master volume.

Output: merged_model (MODEL), straight into your KSampler.

The workflow it closes

The pack's mask pipeline reads like a sentence: generate a mask (Model Mask Generator with a depth_gradient, say), narrow it if you like (Model Key Filter for attention-only, Mask Blender to combine), then apply it here. The README's own example is "take the shallow layers from A, deep layers from B" via a depth gradient - and this is where that happens.

Practical rhythm: after wiring it up, generate at merge_ratio 1.0, then 0.7, then 1.3. Because the mask is the expensive part to design and the ratio is free, you get three merge intensities from one mask.

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. The README's clone URL is typo'd - use Manager or the URL above.

The honest caveat

Two things worth knowing. First, a mask is only as good as its region definitions - a mask built from the wrong architecture's layer indices will quietly misapply, so generate masks on a model matching the ones you merge. Second, this is a young first-author pack, but this particular node is simple enough that there's not much to go wrong: it's a weighted per-tensor merge, the same math a million checkpoint merges have used, just with a mask telling it where to weight what. That's the reason it's the node I'd trust most in the whole pack.

CategoryTensor_Prism/Mask

Inputs (4)

NameTypeDefaultDescription
model_AMODEL
model_BMODEL
maskMASK
merge_ratioFLOAT1.000–2

Outputs (1)

NameTypeDescription
merged_modelMODEL