ModelMergeSDXLTransformers
SDXL merge, but you get to weigh each transformer block yourself
- model1
- model2
- MODEL
A plain SDXL block merge gives you one weight per block, and that's usually enough. This node gives you one weight per transformer block inside each SDXL block - so you can keep the base model's early blocks untouched while surgically pulling just the deep transformer layers out of your style checkpoint. It's the middle step between "coarse" and "unhinged," and for SDXL merging it's the one people actually mean when they say "finer control."
The coarse ModelMergeSDXL in this same pack is, byte for byte, the class ComfyUI now ships as its core per-architecture merge - so this whole family is the lineage that ended up in the main app. The Transformers variant just adds a level of detail the core node skips.
How it works
It subclasses ComfyUI's ModelMergeBlocks, so the mechanics are identical to any ComfyUI merge: each weight is a per-key blend between model1 and model2, matched by longest prefix. What's different is how many weights get generated. SDXL's architecture isn't uniform - input blocks 4 and 5 contain 2 transformer blocks each, blocks 7 and 8 contain 10 each, the middle block contains 10, and the output side mirrors that (block 0 decodes from the 10-transformer middle, and so on). The node generates weights that match that real structure: input_blocks.7.1. for the whole transformer stack, then input_blocks.7.1.transformer_blocks.0. through ...9. so you can weigh each of the ten individually.
Because of the prefix matching, you can leave a specific transformer weight alone and it inherits the value of its enclosing block weight. That's what makes the node usable despite the long input list - set the coarse knobs first, then drill in where it matters.
Inputs and output
- model1, model2 - the two checkpoints.
time_embed.,label_emb.- conditioning embedding blends.input_blocks.N.0.andinput_blocks.N.1.- per-block weights, with.1.expanded intotransformer_blocks.0-9where SDXL has them.middle_block.0-2., with the 10 middle transformer blocks broken out.output_blocks.N.0./.1.- mirrored on the decode side.out.- final layer.
Every weight is FLOAT, 0–1, default 1.0. Remember the ComfyUI convention: 1.0 = take that block from model2, 0.0 = keep model1's. A fresh node with all defaults just outputs model2. Output is a single MODEL - sampler or SaveCheckpoint.
When to bother
If your SDXL merge recipe is "the whole middle block, plus half of block 7," the coarse node is fine. You reach for the Transformers version when the answer is "the first four transformer blocks of block 8, nothing else." Because the deep transformer blocks carry most of the semantic/style weight in SDXL, this is where people tune character models into bases without dragging along the parts they don't want.
Installing it
ComfyUI Manager → search ComfyUI_experiments, or:
cd ComfyUI/custom_nodes
git clone https://github.com/comfyanonymous/ComfyUI_experiments
Restart ComfyUI. No dependencies. It lives under advanced/model_merging.
Verdict
This is the SDXL merge node that splits the difference well: more control than the coarse version, nowhere near the noise of the Detailed sibling. If you merge SDXL checkpoints by hand at all, this is a strong default to reach for.
Inputs (106)
| Name | Type | Default | Description |
|---|---|---|---|
| model1 | MODEL | — | |
| model2 | MODEL | — | |
| time_embed. | FLOAT | 1.000–1 | — |
| label_emb. | FLOAT | 1.000–1 | — |
| input_blocks.0.0. | FLOAT | 1.000–1 | — |
| input_blocks.1.0. | FLOAT | 1.000–1 | — |
| input_blocks.2.0. | FLOAT | 1.000–1 | — |
| input_blocks.3.0. | FLOAT | 1.000–1 | — |
| input_blocks.4.0. | FLOAT | 1.000–1 | — |
| input_blocks.4.1. | FLOAT | 1.000–1 | — |
| input_blocks.4.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| input_blocks.4.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| input_blocks.5.0. | FLOAT | 1.000–1 | — |
| input_blocks.5.1. | FLOAT | 1.000–1 | — |
| input_blocks.5.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| input_blocks.5.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| input_blocks.6.0. | FLOAT | 1.000–1 | — |
| input_blocks.7.0. | FLOAT | 1.000–1 | — |
| input_blocks.7.1. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.2. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.3. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.4. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.5. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.6. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.7. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.8. | FLOAT | 1.000–1 | — |
| input_blocks.7.1.transformer_blocks.9. | FLOAT | 1.000–1 | — |
| input_blocks.8.0. | FLOAT | 1.000–1 | — |
| input_blocks.8.1. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.2. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.3. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.4. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.5. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.6. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.7. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.8. | FLOAT | 1.000–1 | — |
| input_blocks.8.1.transformer_blocks.9. | FLOAT | 1.000–1 | — |
| middle_block.0. | FLOAT | 1.000–1 | — |
| middle_block.1. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.2. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.3. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.4. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.5. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.6. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.7. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.8. | FLOAT | 1.000–1 | — |
| middle_block.1.transformer_blocks.9. | FLOAT | 1.000–1 | — |
| middle_block.2. | FLOAT | 1.000–1 | — |
| output_blocks.0.0. | FLOAT | 1.000–1 | — |
| output_blocks.0.1. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.2. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.3. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.4. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.5. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.6. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.7. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.8. | FLOAT | 1.000–1 | — |
| output_blocks.0.1.transformer_blocks.9. | FLOAT | 1.000–1 | — |
| output_blocks.1.0. | FLOAT | 1.000–1 | — |
| output_blocks.1.1. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.2. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.3. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.4. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.5. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.6. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.7. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.8. | FLOAT | 1.000–1 | — |
| output_blocks.1.1.transformer_blocks.9. | FLOAT | 1.000–1 | — |
| output_blocks.2.0. | FLOAT | 1.000–1 | — |
| output_blocks.2.1. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.2. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.3. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.4. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.5. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.6. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.7. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.8. | FLOAT | 1.000–1 | — |
| output_blocks.2.1.transformer_blocks.9. | FLOAT | 1.000–1 | — |
| output_blocks.3.0. | FLOAT | 1.000–1 | — |
| output_blocks.3.1. | FLOAT | 1.000–1 | — |
| output_blocks.3.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| output_blocks.3.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| output_blocks.4.0. | FLOAT | 1.000–1 | — |
| output_blocks.4.1. | FLOAT | 1.000–1 | — |
| output_blocks.4.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| output_blocks.4.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| output_blocks.5.0. | FLOAT | 1.000–1 | — |
| output_blocks.5.1. | FLOAT | 1.000–1 | — |
| output_blocks.5.1.transformer_blocks.0. | FLOAT | 1.000–1 | — |
| output_blocks.5.1.transformer_blocks.1. | FLOAT | 1.000–1 | — |
| output_blocks.6.0. | FLOAT | 1.000–1 | — |
| output_blocks.7.0. | FLOAT | 1.000–1 | — |
| output_blocks.8.0. | FLOAT | 1.000–1 | — |
| out. | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |