Model Merger (Attention/DARE)
DARE merging aimed at attention and the shell
- model_a
- model_b
- model_mask
- MODEL
Model Merger (Attention/DARE) is the DARE merge with the most opinionated default targeting in the pack. It combines two gradient ideas at once - a "shell" weighting and an attention-element weighting - multiplies them together, and runs DARE-TIES under that combined gradient. The display name says "Attention," but it's really attention plus the shell structure: the node is the two gradient types stacked.
Here's the mental model. The shell gradient divides the UNet into three rings: the exterior (the first and last blocks - where the image enters and leaves), the interior (the middle blocks), and the core (the deep bottleneck around the middle block). The attention gradient divides each block by parameter type: norm, attn, and ff_net. The node computes both from the same model, multiplies them element-wise, and DARE-merges under the result. So a parameter that's both exterior AND attn gets the product of the two ratios; a parameter in either category gets the other category's default.
The inputs that matter
- model_a, model_b - base and injected model.
- exterior, interior, core - shell ratios, all default 1 (keep A).
- norm, attn, ff_net - element ratios, all default 1.
- process_norm, process_attn, process_ff_net - turn a parameter kind on or off entirely. This is how you make it truly "attention only": switch off norm and ff_net and the shell weights apply only to attention parameters.
- drop_rate (default 0.9), ties, rescale, seed, method, iterations - the standard DARE stack. Rescale off, ties on sum, seed fixed.
- model_mask (optional) - parameter-level protection on top.
Why you'd use it
Because it collapses two dials you'd otherwise chain through Gradient Operations into one node. The package's own interest is in targeting: "targeting attention" is a stated design goal of the element variant, and the shell ring is the author's take on the onion idea (there's also a standalone Shell Gradient node in the pack). If your merge should leave the outer layers of model A alone while letting the interior and attention layers borrow from model B, this node says it in one place.
The output
A MODEL patch, same as every merger in the pack - KSampler or Save Checkpoint (MODEL + CLIP + VAE), nothing written to disk on its own.
Install and gotchas
ComfyUI Manager (search "DareMerge") or git clone https://github.com/54rt1n/ComfyUI-DareMerge into ComfyUI/custom_nodes, then restart. Dependencies: matplotlib, numpy, torch, pillow; no downloads. SD1.5 and SDXL only.
The practical caveat: with the product-of-gradients design, a parameter only gets a non-default ratio if both its shell ring and its element kind are non-default. Knock attn down to 0 and every attention parameter - exterior, interior, and core alike - is pinned to model B's values, because the 0 multiplies through the shell ratio. That's powerful and easy to misread; dump the resulting gradient with Gradient Reporting if you're not sure what the multiplication produced, and remember this merge is stochastic, so fix the seed before you compare.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| model_a | MODEL | — | |
| model_b | MODEL | — | |
| drop_rate | FLOAT | 0.900–1 | — |
| ties | COMBO | sum | 3 options: sum, count, off |
| rescale | COMBO | off | 2 options: off, on |
| seed | INT | 10–99999999999 | — |
| method | COMBO | comfy | 12 options: comfy, lerp, slerp, slice, cyclic, gradient, +6 |
| iterations | INT | 11–100 | — |
| exterior | FLOAT | 1.000–1 | — |
| interior | FLOAT | 1.000–1 | — |
| core | FLOAT | 1.000–1 | — |
| process_norm | BOOLEAN | true | — |
| process_attn | BOOLEAN | true | — |
| process_ff_net | BOOLEAN | true | — |
| norm | FLOAT | 1.000–1 | — |
| attn | FLOAT | 1.000–1 | — |
| ff_net | FLOAT | 1.000–1 | — |
| model_maskopt | MODEL_MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |