Nodes/ComfyUI/ModelMergeSDXL
ComfyUI Node Runs on cloud

ModelMergeSDXL

The block-merge node that made the SDXL merge era

By Comfy-Org·Created 4 years ago·Updated 35 minutes ago· 129,939
ModelMergeSDXL
  • model1
  • model2
  • MODEL
time_embed.1.00
label_emb.1.00
input_blocks.01.00
input_blocks.11.00
input_blocks.21.00
input_blocks.31.00
input_blocks.41.00
input_blocks.51.00
input_blocks.61.00
input_blocks.71.00
input_blocks.81.00
middle_block.01.00
middle_block.11.00
middle_block.21.00
output_blocks.01.00
output_blocks.11.00
output_blocks.21.00
output_blocks.31.00
output_blocks.41.00
output_blocks.51.00
output_blocks.61.00
output_blocks.71.00
output_blocks.81.00
out.1.00

SDXL's entire CivitAI economy is built on merges - RealVisXL, Juggernaut XL, and the whole "realistic Pony" sub-genre are the visible tip of it, most of it created by people averaging SDXL checkpoints and picking the result they liked. ModelMergeSDXL is the built-in tool for doing that yourself, and it's the best on-ramp to the whole merge family because it hands you every block of the SDXL UNet as a named slider.

Where ModelMergeBlocks gives you three knobs (input / middle / out) and makes you guess the internal key names, this node pre-labels the actual SDXL architecture. SDXL's UNet is: 9 input blocks, a 3-block middle section, 9 output blocks, plus the time/label embeddings and the final out layer. You get a ratio for each one. That granularity is what people actually use - the "keep composition, swap the skin texture" merges that dominate SDXL realism pages are exactly this.

The usual starting pattern carries over from the classic three-knob node: high ratios on the early input blocks and middle (keep model1's structure), lower on the output blocks (let model2's painterly detail through). It's an equalizer with 24 bands instead of 3. Nobody has a formula; you wiggle and compare.

How it works

It's a subclass of ModelMergeBlocks, which means the mechanism is identical - per-tensor interpolation where each weight becomes ratio · model1 + (1 − ratio) · model2, with the ratio picked by matching the longest key prefix. The only thing this node adds is the SDXL key map: time_embed., label_emb., input_blocks.0 through input_blocks.8, middle_block.02, output_blocks.08, and out.. Each slider default at 1.0 means "all model1 here."

Because the merge happens as patches on model1, you can sample the blended model directly from the graph without saving - set your ratios, wire to a KSampler, render, adjust. The moment you're happy, either stop (if you only wanted to render with it) or route the MODEL into Save Checkpoint to make it a file.

The inputs that matter

  • model1, model2 (MODEL) - two SDXL checkpoints.
  • time_embed., label_emb. - the noise-level/time conditioning and the pooled text embedding. These are small, and merging them controls "how model-like" the timestep and prompt conditioning feel. Leave them at 1.0 unless something's weird.
  • input_blocks.08 - the encoder. Early blocks = composition and layout.
  • middle_block.02 - the bottleneck; the deepest, most "structural" part of the model.
  • output_blocks.08 - the decoder. Later blocks = detail, texture, finish.
  • out. - the final convolution.

One MODEL out, into a KSampler, a LoRA, or another merge.

Where people get burned

SDXL versions and VAE mismatches are the classic pains. Merging an SDXL checkpoint that expects a different VAE than your target can gray out or wash out results - the KB's troubleshooting notes on mismatched VAE and gray output apply. And remember the merge caveat that applies to the entire family: blending two SDXL models averages their defects too, and the more similar the parents, the more coherent the child. Pony-into-realism merges worked but needed serious inpainting afterward; that's the ceiling of the technique.

Also worth knowing: this node is SDXL-specific by design. It won't merge SD 1.5 checkpoints (different block layout - that's ModelMergeSD1/SD2) and it certainly won't handle a transformer model.

How you get it

Ships with ComfyUI core under model/merging/model specific. Landed in April 2024 alongside the SD1/SD2 variants. Nothing to install.

Categorymodel/merging/model specific

Inputs (26)

NameTypeDefaultDescription
model1MODEL
model2MODEL
time_embed.FLOAT1.000–1
label_emb.FLOAT1.000–1
input_blocks.0FLOAT1.000–1
input_blocks.1FLOAT1.000–1
input_blocks.2FLOAT1.000–1
input_blocks.3FLOAT1.000–1
input_blocks.4FLOAT1.000–1
input_blocks.5FLOAT1.000–1
input_blocks.6FLOAT1.000–1
input_blocks.7FLOAT1.000–1
input_blocks.8FLOAT1.000–1
middle_block.0FLOAT1.000–1
middle_block.1FLOAT1.000–1
middle_block.2FLOAT1.000–1
output_blocks.0FLOAT1.000–1
output_blocks.1FLOAT1.000–1
output_blocks.2FLOAT1.000–1
output_blocks.3FLOAT1.000–1
output_blocks.4FLOAT1.000–1
output_blocks.5FLOAT1.000–1
output_blocks.6FLOAT1.000–1
output_blocks.7FLOAT1.000–1
output_blocks.8FLOAT1.000–1
out.FLOAT1.000–1

Outputs (1)

NameTypeDescription
MODELMODEL