𧬠Merge SDXL
Block-weight merging for SDXL's 9 U-Net blocks
- model1
- model2
- model
- mbw
The SDXL sibling of Merge SD1 - same idea, different block count. SDXL's U-Net has 9 IN blocks and 9 OUT blocks (down from SD 1.5's 12, SDXL's architecture is just smaller in that dimension), plus one middle block, and this node lets you blend two SDXL checkpoints per block instead of averaging the whole model with a single ratio.
Why per-block, not a flat average
Merging is averaging weights, and averaging is exactly why the checkpoint ecosystem is full of models that converge on the same faces and inherit each other's quirks - you're not adding anything new, just interpolating between what already exists. A flat 50/50 merge gives you the most generic version of both parents. Block weighting is the difference between that and something you actually meant to build: push the blocks that shape composition toward one model and the blocks that shape fine detail toward the other, and you land somewhere neither parent reaches alone - assuming the two are close enough in style to begin with.
The inputs and outputs that matter
input_blocks- per-block weights for SDXL's 9 IN blocks (0β8). Same three writing styles as the rest of the pack's merge tools: a plain comma list (one value per block),block:weightpairs where anything unlisted inherits the last value, or ranges (start-end:weight). Default0-4:1,5-8:1covers all 9 with the range form.middle_block- one weight for SDXL's single middle block, default1.output_blocks- same idea for the 9 OUT blocks, default given as the plain list1,1,1,1,1,1,1,1,1(nine entries - count them if you're editing by hand, it's easy to drop one and shift everything after it).model1/model2(optional) - the two SDXL checkpoints to blend.
Outputs: the merged model, plus mbw, a string of the block-weight pattern that was actually applied - useful for keeping a record of what you ran or reusing the same pattern elsewhere.
Installing it
ComfyUI Manager: search SDVN_Comfy_node, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node
Then pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt from your ComfyUI root, and restart.
Where people get burned
Block count confusion coming from SD 1.5 habits. If you've used the pack's Merge SD1 node, note the count changes here - 9 blocks each side, not 12. A block-weight string copied over from an SD 1.5 merge will apply to the wrong blocks (or error out) because the indices don't mean the same thing.
Cross-architecture merges. SDXL and SD 1.5 (or Flux) checkpoints have different weight shapes entirely - this node is for two SDXL models only. There's no version of "merge SDXL into SD 1.5"; the tensors don't line up.
The output_blocks list needs exactly 9 entries when written positionally. Miscount by one while editing and every block after your mistake gets the wrong weight silently - nothing validates the count against the architecture for you, so double-check before you run a merge you're planning to save.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| input_blocks | STRING | 0-4:1,5-8:1 | β |
| middle_block | STRING | 1 | β |
| output_blocks | STRING | 1,1,1,1,1,1,1,1,1 | β |
| model1opt | MODEL | β | |
| model2opt | MODEL | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | MΓ΄ hΓ¬nh ΔΓ£ gα»p |
| mbw | STRING | ThΓ΄ng sα» MBW ΔΓ£ dΓΉng |