Nodes/comfyui_davcha/DavchaModelMergeSDXL
ComfyUI Node

DavchaModelMergeSDXL

Block-weighted merging for the SDXL UNet

By dchatel·Created 2 years ago·Updated 5 days ago· 2
DavchaModelMergeSDXL
  • model1
  • model2
  • MODEL
time_embed.1.000
label_emb.1.000
input_blocks.01.000
input_blocks.11.000
input_blocks.21.000
input_blocks.31.000
input_blocks.41.000
input_blocks.51.000
input_blocks.61.000
input_blocks.71.000
input_blocks.81.000
middle_block.01.000
middle_block.11.000
middle_block.21.000
output_blocks.01.000
output_blocks.11.000
output_blocks.21.000
output_blocks.31.000
output_blocks.41.000
output_blocks.51.000
output_blocks.61.000
output_blocks.71.000
output_blocks.81.000
out.1.000

SDXL's UNet doesn't have the same anatomy as SD1.5's, so a block merge node needs a different layout. DavchaModelMergeSDXL is the SDXL version of the pack's SD1 block merge: a separate ratio for the time embedding, the label embedding, the nine input blocks, three middle blocks, nine output blocks, and the output layer. Same idea - structure from one parent, style from the other - tuned for the architecture that actually runs SDXL checkpoints.

It's from comfyui_davcha, the "personal QoL and experimental nodes" pack, and like its SD1 sibling it reuses ComfyUI's ModelMergeBlocks base class with the ratio range opened up to -5 to 6 so negative (subtractive) block weights work.

How it works

The ratios map directly onto SDXL's diffusion model key prefixes: time_embed., label_emb., input_blocks.0 through input_blocks.8, middle_block.0.2, output_blocks.0output_blocks.8, and out.. Note there's no trailing dot on the SDXL block names (SD1.5's have them) - that's just how the two architectures name their keys. Each float is model2's weight for that block; model1 receives 1 - ratio. Same pattern as SD1.5 applies: early blocks govern structure and composition, later blocks carry style and fine detail, and negative values subtract a parent's influence from that region.

Inputs: model1, model2, plus one FLOAT per block (default 1.0, -5 to 6). Output: MODEL.

When you'd reach for it

  • Hybrid SDXL checkpoints - mix a photographic base's realism with a stylized model's palette, controlling where the style lands.
  • In-graph prototyping - dial in a block map live before baking it into a merged file.
  • Targeted fixes - a merged SDXL picked up bad detail in the output blocks; reduce or negate exactly those.

Installing it

# ComfyUI Manager → Install Custom Nodes → search "comfyui_davcha" → Install → Restart
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/dchatel/comfyui_davcha
cd comfyui_davcha
pip install -r requirements.txt

Usual pack catch: nodes.py imports llama_cpp and cv2 at module load but requirements.txt only lists webp and rapidfuzz. If the pack doesn't appear, pip install llama-cpp-python opencv-python and restart.

The main way people get burned is architecture mismatch: feed an SD1.5 or SD3 model into this and the block keys won't match, producing a merge that does nothing useful or errors. SDXL only. Otherwise the same caveats as any deep merge apply - move a few blocks at a time, watch for coherence loss, and remember that a lot of the community's SDXL models are themselves merges, so layering another merge on top of a merge compounds the mush.

Categoryadvanced/model_merging/model_specific

Inputs (26)

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

Outputs (1)

NameTypeDescription
MODELMODEL