Nodes/SDVN_Comfy_node/🧬 Merge SD1
ComfyUI Node

🧬 Merge SD1

Block-weight merging for SD 1.5's 12 U-Net blocks

By StableDiffusionVNΒ·Created 2 years agoΒ·Updated 29 days agoΒ· 118
🧬 Merge SD1
  • model1
  • model2
  • model
  • mbw
β—„input_blocks0-6:1,7-11:1β–Ί
β—„middle_block1β–Ί
β—„output_blocks1,1,1,1,1,1,1,1,1,1,1,1β–Ί

This is a dedicated block-weight merger for SD 1.5 models - you feed it two models and it blends them block by block through the U-Net's 12 IN blocks, the middle block, and the 12 OUT blocks, instead of averaging the whole network with one flat ratio. If the pack's general-purpose Model Merge node is the "merge two or three checkpoints, several modes, save to disk" tool, this is the narrower one: SD1.5-specific, and built entirely around getting the per-block weighting right.

Why block weighting beats a flat merge

A checkpoint is just weights, and merging is literally averaging two sets of them. Average the whole thing uniformly and you get the generic problem every merge has: you're not training anything new, you're interpolating, and a 50/50 blend of two models that disagree tends to land somewhere blander than either parent. Block weighting is what makes a merge deliberate instead of a coin flip - different blocks in the U-Net control different things (early blocks skew toward composition and structure, later ones toward fine detail and style), so you can pull hard on the blocks that carry the trait you want from model B while leaving the blocks that matter to model A alone.

The inputs and outputs that matter

  • input_blocks - the per-block weight string for SD 1.5's 12 IN blocks (0–11). The pack supports three ways to write this: a flat list of comma-separated values (0,1,1,0,…, one per block in order), explicit block:weight pairs (4:0, 5:1, unlisted blocks inherit the last value given), or ranges (0-6:1). The default 0-6:1,7-11:1 mixes the range form with itself to set every block to 1.
  • middle_block - a single weight for SD 1.5's one middle block. Default 1.
  • output_blocks - same idea as input_blocks but for the 12 OUT blocks, default written as the plain positional list 1,1,1,1,1,1,1,1,1,1,1,1.
  • model1 / model2 (optional) - the two checkpoints to blend, wired from your checkpoint loaders.

Outputs are the merged model and mbw, a string echoing the resolved block-weight pattern actually applied - handy for logging what you ran, or feeding into another node that wants to reuse the same pattern.

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

Wrong architecture, full stop. This node is SD 1.5-specific - 12 IN blocks, 1 middle, 12 OUT. Feed it an SDXL or Flux model and the block counts won't line up with what the node expects; use the pack's separate Merge SDXL node for that family instead.

Getting the three syntaxes crossed. The defaults deliberately show all three writing styles at once (range shorthand in input_blocks, a bare number in middle_block, a plain list in output_blocks) - that's the README's own demonstration, not three unrelated formats you have to pick just one of. Mixing them within a single field is fine; getting the block count wrong for the field you're editing is what actually breaks things.

Expecting the merge to fix a bad pairing. Block weighting controls where the blend happens, not whether the two models are compatible in the first place. Two checkpoints that are already stylistically close will merge into something coherent; two that fight each other will still fight, just with more precise knobs.

CategoryπŸ“‚ SDVN/🧬 Merge

Inputs (5)

NameTypeDefaultDescription
input_blocksSTRING0-6:1,7-11:1β€”
middle_blockSTRING1β€”
output_blocksSTRING1,1,1,1,1,1,1,1,1,1,1,1β€”
model1optMODELβ€”
model2optMODELβ€”

Outputs (2)

NameTypeDescription
modelMODELMô hình đã gộp
mbwSTRINGThΓ΄ng sα»‘ MBW Δ‘Γ£ dΓΉng