DavchaModelMergeSDXL
Block-weighted merging for the SDXL UNet
- model1
- model2
- MODEL
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.0–output_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.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| model1 | MODEL | — | |
| model2 | MODEL | — | |
| time_embed. | FLOAT | 1.000-5–6 | — |
| label_emb. | FLOAT | 1.000-5–6 | — |
| input_blocks.0 | FLOAT | 1.000-5–6 | — |
| input_blocks.1 | FLOAT | 1.000-5–6 | — |
| input_blocks.2 | FLOAT | 1.000-5–6 | — |
| input_blocks.3 | FLOAT | 1.000-5–6 | — |
| input_blocks.4 | FLOAT | 1.000-5–6 | — |
| input_blocks.5 | FLOAT | 1.000-5–6 | — |
| input_blocks.6 | FLOAT | 1.000-5–6 | — |
| input_blocks.7 | FLOAT | 1.000-5–6 | — |
| input_blocks.8 | FLOAT | 1.000-5–6 | — |
| middle_block.0 | FLOAT | 1.000-5–6 | — |
| middle_block.1 | FLOAT | 1.000-5–6 | — |
| middle_block.2 | FLOAT | 1.000-5–6 | — |
| output_blocks.0 | FLOAT | 1.000-5–6 | — |
| output_blocks.1 | FLOAT | 1.000-5–6 | — |
| output_blocks.2 | FLOAT | 1.000-5–6 | — |
| output_blocks.3 | FLOAT | 1.000-5–6 | — |
| output_blocks.4 | FLOAT | 1.000-5–6 | — |
| output_blocks.5 | FLOAT | 1.000-5–6 | — |
| output_blocks.6 | FLOAT | 1.000-5–6 | — |
| output_blocks.7 | FLOAT | 1.000-5–6 | — |
| output_blocks.8 | FLOAT | 1.000-5–6 | — |
| out. | FLOAT | 1.000-5–6 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |