SDXL Advanced Block Merge (Tensor Prism)
Block-level control when your GPU is small
- model_A
- model_B
- model_C
- MODEL
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.
Inputs (41)
| Name | Type | Default | Description |
|---|---|---|---|
| model_A | MODEL | — | |
| model_B | MODEL | — | |
| merge_method | COMBO | 3 options: Linear Interpolation, Add Difference, TIES-Merging (Simplified) | |
| default_unet_ratio | FLOAT | 0.500–1 | — |
| memory_limit_gb | FLOAT | 8.01–64 | — |
| force_cpu | BOOLEAN | false | — |
| batch_size | INT | 501–500 | — |
| auto_memory_management | BOOLEAN | true | — |
| model_Copt | MODEL | — | |
| ties_global_alpha_Aopt | FLOAT | 0.500–1 | — |
| ties_global_alpha_Bopt | FLOAT | 0.500–1 | — |
| rescale_output_magnitudesopt | BOOLEAN | false | — |
| iterationsopt | INT | 11–100 | — |
| a_delta_factoropt | FLOAT | 1.00-2–2 | — |
| b_delta_factoropt | FLOAT | 1.00-2–2 | — |
| precision_modeopt | COMBO | auto | 3 options: auto, fp16, fp32 |
| aggressive_cleanupopt | BOOLEAN | true | — |
| out_ratioopt | FLOAT | 0.500–1 | — |
| time_embed_ratioopt | FLOAT | 0.500–1 | — |
| label_emb_ratioopt | FLOAT | 0.500–1 | — |
| input_block_00_ratioopt | FLOAT | 0.500–1 | — |
| output_block_00_ratioopt | FLOAT | 0.500–1 | — |
| input_block_01_ratioopt | FLOAT | 0.500–1 | — |
| output_block_01_ratioopt | FLOAT | 0.500–1 | — |
| input_block_02_ratioopt | FLOAT | 0.500–1 | — |
| output_block_02_ratioopt | FLOAT | 0.500–1 | — |
| input_block_03_ratioopt | FLOAT | 0.500–1 | — |
| output_block_03_ratioopt | FLOAT | 0.500–1 | — |
| input_block_04_ratioopt | FLOAT | 0.500–1 | — |
| output_block_04_ratioopt | FLOAT | 0.500–1 | — |
| input_block_05_ratioopt | FLOAT | 0.500–1 | — |
| output_block_05_ratioopt | FLOAT | 0.500–1 | — |
| input_block_06_ratioopt | FLOAT | 0.500–1 | — |
| output_block_06_ratioopt | FLOAT | 0.500–1 | — |
| input_block_07_ratioopt | FLOAT | 0.500–1 | — |
| output_block_07_ratioopt | FLOAT | 0.500–1 | — |
| input_block_08_ratioopt | FLOAT | 0.500–1 | — |
| output_block_08_ratioopt | FLOAT | 0.500–1 | — |
| middle_block_00_ratioopt | FLOAT | 0.500–1 | — |
| middle_block_01_ratioopt | FLOAT | 0.500–1 | — |
| middle_block_02_ratioopt | FLOAT | 0.500–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |