Nodes/ComfyUI/ModelMergeSD1
ComfyUI Node Runs on cloud

ModelMergeSD1

The 30-slider workhorse that merging was built on

By Comfy-Org·Created 4 years ago·Updated about 21 hours ago· 129,495
ModelMergeSD1
  • model1
  • model2
  • MODEL
time_embed.1.00
label_emb.1.00
input_blocks.0.1.00
input_blocks.1.1.00
input_blocks.2.1.00
input_blocks.3.1.00
input_blocks.4.1.00
input_blocks.5.1.00
input_blocks.6.1.00
input_blocks.7.1.00
input_blocks.8.1.00
input_blocks.9.1.00
input_blocks.10.1.00
input_blocks.11.1.00
middle_block.0.1.00
middle_block.1.1.00
middle_block.2.1.00
output_blocks.0.1.00
output_blocks.1.1.00
output_blocks.2.1.00
output_blocks.3.1.00
output_blocks.4.1.00
output_blocks.5.1.00
output_blocks.6.1.00
output_blocks.7.1.00
output_blocks.8.1.00
output_blocks.9.1.00
output_blocks.10.1.00
output_blocks.11.1.00
out.1.00

Merging is how a huge chunk of CivitAI got made. It takes minutes instead of the days-to-weeks a fine-tune needs, requires no training data and no GPU, and it's just math: a weighted average of two existing checkpoints. This node is the classic per-block merge for SD1.x - the UNet skeleton that the whole hobby grew up on, and the place where the "block merge" concept was born. If you've ever wondered how people make hybrid checkpoints that combine two model's strengths, this is the on-ramp.

How it works

Same engine as the whole merge family: model1 is cloned as the base, then every weight tensor in model2 is mixed in with model1_weight * (1 - ratio) + model2_weight * ratio, where ratio is the slider whose name is the longest prefix of that weight's key. So input_blocks.4. covers everything inside input block 4.

The default-1.0 trap applies here too: every slider defaults to 1.0, which means "take model2." Wire up two models and run without touching sliders and you get pure model2, not a blend. Set the sliders to 0 and you get model1. 0.5 is a true 50/50. Base goes in model1, flavor goes in model2, and you usually lower the sliders.

The sliders, and the folklore about them

SD1.5's UNet breaks into 30 inputs. The ones beginners actually touch:

  • input_blocks.0.input_blocks.11. - the encoder that downsamples the latent. Community folklore puts the "coarse" structure here.
  • middle_block.0.middle_block.2. - the bottleneck. This is where the "content" or "concept" of the model supposedly lives.
  • output_blocks.0.output_blocks.11. - the decoder that builds detail back up. The folklore says fine detail and texture hang out here.
  • time_embed. and label_emb. - the timestep and text/prompt conditioning, and out. - the final conv.

The folklore is a map, not a law - different recipes (style transfer vs. character mixing) move different sliders, and the only way to know is to generate test grids. The classic style-transfer trick leans on keeping the base's early structure and blending the later blocks, but expect to experiment. Merges of similar-aesthetic models come out consistent; forcing two totally different styles together usually gives you what one old r/StableDiffusion post called "ugly garbage - but that's to be expected."

Gotchas

  • Both inputs must be SD1.5-class UNets. SDXL has a different block layout and its own node (ModelMergeSDXL); cross-architecture merges match no weight keys and silently output model1.
  • Merges inherit defects. This is the documented convergence problem - the more models get merged from merged models, the more they all start looking alike. It's why the community treats fine-tunes as more coherent than merges.
  • If you stack LoRAs on the loaded models before merging, the merge bakes those in too. Clean loads for a clean merge.

SD1.5 block merging is old-school now, and most people just download fine-tunes instead of making their own. But if you want to actually understand what a merge is doing - or you're mixing two models you love and want a hybrid - this is the node to learn on. It landed in ComfyUI in April 2024 as part of the model-specific merge family, and it ships with core.

Categorymodel/merging/model specific

Inputs (32)

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

Outputs (1)

NameTypeDescription
MODELMODEL