Nodes/Tensor Prism/SDXL Advanced Block Merge (Tensor Prism)
ComfyUI Node

SDXL Advanced Block Merge (Tensor Prism)

Block-level control when your GPU is small

By Arctenox·Created 12 months ago·Updated 7 months ago· 2
SDXL Advanced Block Merge (Tensor Prism)
  • model_A
  • model_B
  • model_C
  • MODEL
merge_method
default_unet_ratio0.50
memory_limit_gb8.0
force_cpufalse
batch_size50
auto_memory_managementtrue
ties_global_alpha_A0.50
ties_global_alpha_B0.50
rescale_output_magnitudesfalse
iterations1
a_delta_factor1.00
b_delta_factor1.00
precision_modeauto
aggressive_cleanuptrue
out_ratio0.50
time_embed_ratio0.50
label_emb_ratio0.50
input_block_00_ratio0.50
output_block_00_ratio0.50
input_block_01_ratio0.50
output_block_01_ratio0.50
input_block_02_ratio0.50
output_block_02_ratio0.50
input_block_03_ratio0.50
output_block_03_ratio0.50
input_block_04_ratio0.50
output_block_04_ratio0.50
input_block_05_ratio0.50
output_block_05_ratio0.50
input_block_06_ratio0.50
output_block_06_ratio0.50
input_block_07_ratio0.50
output_block_07_ratio0.50
input_block_08_ratio0.50
output_block_08_ratio0.50
middle_block_00_ratio0.50
middle_block_01_ratio0.50
middle_block_02_ratio0.50

Plain block merging is a memory hog: you're holding two or three full SDXL UNets in VRAM and interpolating them tensor by tensor. On a 12GB card that gets cozy fast, and on an 8GB one it's a non-starter. SDXL Advanced Block Merge (Tensor Prism) is this pack's answer - the same per-block merge as the plain SDXLBlockMergeTensorPrism node, but wrapped in a memory-management layer that batches parameter processing, auto-picks fp16 vs fp32, spills to CPU when it has to, and cleans up after itself.

If you just want to blend two SDXL checkpoints with per-block ratios and don't care about the plumbing, the plain node is fine. Reach for this one when you're on a 12GB-or-smaller card, or when merges are OOM-killing your session.

How it works

You wire in model_A and model_B (optionally a model_C for three-way merges) and pick a merge_method:

  • Linear Interpolation - the weighted average, per block.
  • Add Difference - blend "B minus A" into the result, the classic way to graft one model's character onto another.
  • TIES-Merging (Simplified) - a trimmed TIES (trim, elect sign, merge) that drops conflicting-sign tensors before averaging, which tends to reduce the mush you get from naively averaging dissimilar models.

default_unet_ratio (0.5) is the global blend point, and then you get per-block ratios for the whole SDXL stack: time_embed_ratio, label_emb_ratio, out_ratio, input_block_00_ratio through input_block_08_ratio, output_block_00_ratio through output_block_08_ratio, and middle_block_00/01/02_ratio. Early input blocks shape composition; output blocks carry detail. TIES mode adds ties_global_alpha_A/B for how hard each parent pulls, plus rescale_output_magnitudes and a_delta_factor/b_delta_factor if you want to push the delta math.

The advanced part is the machinery: memory_limit_gb (default 8) tells it how much VRAM it may use, auto_memory_management lets it decide device placement, precision_mode (auto/fp16/fp32) sets the working dtype, batch_size (default 50) controls how many parameters it processes per chunk, and force_cpu shunts everything to system RAM when your card taps out. iterations reruns the merge loop, and aggressive_cleanup keeps VRAM from accumulating dead tensors. Output is a single MODEL.

The settings that matter

For an 8GB card, README's own recommendation: memory_limit_gb around 6, batch size 10–30, and be ready to tick force_cpu. On 12GB: limit 8, batch 30–50, keep auto precision. And the honest caveat straight from the author's dev notes: he's not certain the block-layer merging still behaves on current ComfyUI (1.6.5+), and suggests falling back to the built-in ModelMergeSDXL for block ratios if your result looks wrong. That's a real warning, not boilerplate - the pack is young and self-described as vibe-coded.

Installing it

ComfyUI Manager → search "Tensor Prism" → Install, or:

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

Then restart. No model downloads; dependencies are torch, numpy, psutil - all already present in a normal ComfyUI install. Skip the clone URL in the pack's README; it's typo'd.

The trap

More knobs isn't the same as better merges. Start with default_unet_ratio alone, sanity-check against a built-in merge, and only reach for block ratios once you know which region you're trying to move. If the merged model comes out wrong or artifacts, the README's advice is sound: back off to ModelMergeSDXL for the block layer and keep this node for the memory-friendly heavy lifting.

CategoryTensor_Prism/Merge

Inputs (41)

NameTypeDefaultDescription
model_AMODEL
model_BMODEL
merge_methodCOMBO3 options: Linear Interpolation, Add Difference, TIES-Merging (Simplified)
default_unet_ratioFLOAT0.500–1
memory_limit_gbFLOAT8.01–64
force_cpuBOOLEANfalse
batch_sizeINT501–500
auto_memory_managementBOOLEANtrue
model_CoptMODEL
ties_global_alpha_AoptFLOAT0.500–1
ties_global_alpha_BoptFLOAT0.500–1
rescale_output_magnitudesoptBOOLEANfalse
iterationsoptINT11–100
a_delta_factoroptFLOAT1.00-2–2
b_delta_factoroptFLOAT1.00-2–2
precision_modeoptCOMBOauto3 options: auto, fp16, fp32
aggressive_cleanupoptBOOLEANtrue
out_ratiooptFLOAT0.500–1
time_embed_ratiooptFLOAT0.500–1
label_emb_ratiooptFLOAT0.500–1
input_block_00_ratiooptFLOAT0.500–1
output_block_00_ratiooptFLOAT0.500–1
input_block_01_ratiooptFLOAT0.500–1
output_block_01_ratiooptFLOAT0.500–1
input_block_02_ratiooptFLOAT0.500–1
output_block_02_ratiooptFLOAT0.500–1
input_block_03_ratiooptFLOAT0.500–1
output_block_03_ratiooptFLOAT0.500–1
input_block_04_ratiooptFLOAT0.500–1
output_block_04_ratiooptFLOAT0.500–1
input_block_05_ratiooptFLOAT0.500–1
output_block_05_ratiooptFLOAT0.500–1
input_block_06_ratiooptFLOAT0.500–1
output_block_06_ratiooptFLOAT0.500–1
input_block_07_ratiooptFLOAT0.500–1
output_block_07_ratiooptFLOAT0.500–1
input_block_08_ratiooptFLOAT0.500–1
output_block_08_ratiooptFLOAT0.500–1
middle_block_00_ratiooptFLOAT0.500–1
middle_block_01_ratiooptFLOAT0.500–1
middle_block_02_ratiooptFLOAT0.500–1

Outputs (1)

NameTypeDescription
MODELMODEL