DonutWidenMergeUNet
Merge checkpoints by importance, not by blind averaging
- model_base
- model_other
- lora_stack
- model_3
- model_4
- model_5
- model_6
- model_7
- model_8
- model_9
- model_10
- model_11
- model_12
- model
- merge_results
- parameter_info
Most model merges treat every weight equally: blend model A and model B at 50/50 and hope the good parts survive. That works until it doesn't - because some layers in A carry important, specialized knowledge while the same layers in B are near-garbage, and a flat average waters both down. DonutWidenMergeUNet is the pack's importance-weighted answer. It looks at each parameter, decides how much it actually matters to each source model, and blends accordingly - the WIDEN ("weight-based importance") approach, with the knobs to control how aggressive that discrimination is.
This is the heavyweight merge tool in the ComfyUI-DonutNodes pack, and it's aimed at people doing real checkpoint surgery - merging SDXL models, blending a character LoRA's strength distribution into a base, or combining several models into one. If your merges are simple 50/50 jobs, the stock ComfyUI ModelMergeSimple is fine; this is for when you want control over which weights dominate the result.
What it does
Under the hood it classifies every parameter by architectural role (time/class embeddings, cross-attention, self-attention, convs, norms, biases), assigns importance weights per role, and uses a compatibility score to decide how far each weight moves toward the other model. That's the thing that separates it from a weighted average: a parameter where model A is confident and model B is weak barely moves, so you keep A's expertise without importing B's noise. There's also neuron alignment (Hungarian matching on linear layers), embedding-transpose detection, and a norm-recalibration step - the sort of hygiene the merge nerds argue about.
The controls that matter:
- merge_strength - overall intensity (0–5, default 1). How far toward
model_otherthe merge goes. - min_strength / max_strength - the range each parameter's blend ratio is allowed to occupy. Keep
minat 0 andmaxat 1 for a normal merge; widen the range to push harder. - normalization_mode -
magnitude(default),calibrate, ornone.magnituderenormalizes so overall weight magnitude doesn't drift;calibrateruns a calibration pass. Start with the default. - importance_threshold (default 1), importance_boost (default 1) - how selective the importance filter is. Raise the threshold to keep more of
model_base's structure. - rank_sensitivity (default 2), skip_threshold (default 0) - the compatibility gating.
skip_thresholdabove 0 starts skipping parameters entirely when compatibility is low, which is the "don't import this at all" control.
You also get optional slots for up to 11 more models (model_3…model_12) and a lora_stack input, plus scale_to_min_max and invert_strengths toggles for fine-tuning the distribution. Most people will use model_base + model_other and one or two extras.
Outputs: model (the merged result, wire it to a KSampler), plus merge_results and parameter_info STRINGs with per-parameter diagnostics - genuinely useful the first time a merge goes sideways, since they tell you what actually moved.
Practical notes
- Save your work. The pack has a
DonutModelSavenode for merged models - a merge this configurable should be saved to disk, not left as a live graph you regenerate every run. - The CLIP needs merging too.
DonutWidenMergeCLIPis the companion for text encoders. Merge the UNet and the CLIP with matching settings or the prompt side won't match the image side. - Slow first run. The compatibility analysis samples parameters to tune the distribution; that's seconds, not minutes, but it's not instant either.
- Opinion: the defaults are sensible, so don't touch the advanced knobs until you've seen a result.
merge_strengthandmin/max_strengthget you 90% of the way. The importance machinery is there for when the naive merge clearly loses something - that's when it earns its complexity.
Install
Part of ComfyUI-DonutNodes: ComfyUI Manager → search "DonutNodes" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/DonutsDelivery/ComfyUI-DonutNodes.git donutnodes
cd donutnodes
python -m pip install -r requirements.txt
The pack's dependencies (opencv-python-headless, scipy, matplotlib, psutil, tqdm, requests) are all it needs - scipy does the neuron-alignment work, and it's in the list. No model downloads.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| model_base | MODEL | — | |
| model_other | MODEL | — | |
| merge_strength | FLOAT | 1.000–5 | — |
| min_strength | FLOAT | 0.00–5 | — |
| max_strength | FLOAT | 1.00.1–5 | — |
| normalization_mode | COMBO | magnitude | 3 options: magnitude, calibrate, none |
| importance_threshold | FLOAT | 1.00–500 | — |
| importance_boost | FLOAT | 1.00–3 | — |
| rank_sensitivity | FLOAT | 2.00–10 | — |
| skip_threshold | FLOAT | 0.00000–1 | — |
| lora_stackopt | LORA_STACK | — | |
| model_3opt | MODEL | — | |
| model_4opt | MODEL | — | |
| model_5opt | MODEL | — | |
| model_6opt | MODEL | — | |
| model_7opt | MODEL | — | |
| model_8opt | MODEL | — | |
| model_9opt | MODEL | — | |
| model_10opt | MODEL | — | |
| model_11opt | MODEL | — | |
| model_12opt | MODEL | — | |
| scale_to_min_maxopt | BOOLEAN | false | — |
| invert_strengthsopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| merge_results | STRING | — |
| parameter_info | STRING | — |