DavchaModelMergeSD1
Per-block checkpoint merging for the SD1.5 UNet
- model1
- model2
- MODEL
A single-ratio merge treats the whole model the same. This node treats it as 30 separate parts. DavchaModelMergeSD1 gives you an individual ratio for every block of an SD1.5 UNet - the time embedding, the label embedding, each of the twelve input blocks, the three middle blocks, each of the twelve output blocks, and the final output layer. Different weights in different places is how you get "structure from model A, style from model B," which is a fundamentally different - and often better - merge than a global blend.
It's from comfyui_davcha, the "personal QoL and experimental nodes" pack, and it's a reskin of ComfyUI's own ModelMergeBlocks with one meaningful change: the ratio range opens up to -5 to 6 (core caps at 0 to 1), so negative block weights are on the table.
How it works
The block names are the actual key prefixes of the SD1.5 diffusion model: time_embed., label_emb., input_blocks.0. through .11., middle_block.0.–.2., output_blocks.0.–.11., and out.. Each float is the weight of model2 in that block; model1 gets 1 - ratio there. Set every block to the same value and it behaves like a simple merge; vary them and you're doing block-weighted merging. The classic pattern: keep the early input blocks (which carry structure and composition) closer to model1, and let the later output blocks (which carry style and detail) swing toward model2. Negative values subtract model2 from that block.
Inputs: model1, model2, then one FLOAT per block (all default 1.0, -5 to 6). Output: MODEL.
When you'd reach for it
- Style surgery - lift the painting style out of one checkpoint and graft it onto another's subject handling.
- Fix an over-merged model - scrub an unwanted influence out of specific layers instead of the whole thing.
- Prototyping a checkpoint you'll bake later - find the block map you like in-graph, then replicate it in a proper merge tool.
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
Pack-level note: the module imports llama_cpp and cv2 at load, neither in requirements.txt. Pack missing from the menu? pip install llama-cpp-python opencv-python, restart.
One crucial scope warning: this block layout is SD1.5's. SDXL's UNet has a different block map (nine input blocks, nine output, and keys without trailing dots), so if you feed an SDXL model in here the key patches won't line up - use DavchaModelMergeSDXL for that. And block-weighted merging rewards patience: start with all blocks at 1.0, move one region at a time, and watch for coherence loss, which is the standing risk with any deep merge.
Inputs (32)
| 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 | — |
| input_blocks.9. | FLOAT | 1.000-5–6 | — |
| input_blocks.10. | FLOAT | 1.000-5–6 | — |
| input_blocks.11. | 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 | — |
| output_blocks.9. | FLOAT | 1.000-5–6 | — |
| output_blocks.10. | FLOAT | 1.000-5–6 | — |
| output_blocks.11. | FLOAT | 1.000-5–6 | — |
| out. | FLOAT | 1.000-5–6 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |