Merge Models (3 Models)
Three-way blending for UNet-only diffusion models
- output_filename
- documentation
ModelTwoMerger with a third input. Same idea as CheckpointThreeMerger vs CheckpointTwoMerger, just aimed at standalone diffusion-model files instead of full checkpoints - the UNet-only weights you'd load through a dedicated diffusion-model loader rather than a checkpoint loader, which is how most Flux-family workflows are wired. If you're merging three of those in one shot instead of chaining two-way merges twice, this is the node.
How it works
model_a, model_b, model_c are your three source models. calc_mode picks the merge algorithm - the dropdown's option list isn't documented in the schema, so open it on your install to see what's there. The six weight knobs default to the three-input pattern this pack uses consistently: alpha, beta, gamma all at 0.5 (one knob per source, a flat three-way split reads as the obvious default), delta at 2, epsilon at 0.01, zeta at 0 - the same shape as CheckpointThreeMerger and LoRAThreeMerger. None of the six ship a tooltip, so the defaults are your best guide until you've experimented or checked what your particular calc_mode does with them.
mismatch_mode (default skip) and alignment_mode (default pad/crop) reconcile tensors that don't match across all three source models - worth knowing this exists as a real setting, because three separately fine-tuned UNets frequently don't share identical layer shapes even within the same architecture family. exclude_patterns/discard_patterns (regex, glob if glob_patterns is on) scope specific layers out of the merge. lazy_load streams tensors from disk rather than loading three full models into memory at once - worth keeping on here more than almost anywhere else in the pack, since three UNets in VRAM simultaneously is a real number. force_clear_cache trades speed for headroom, save_dtype/override_dtype set output precision, process_device picks CPU or GPU, and seed covers whichever calc_mode uses randomness. Output is output_filename (default merged_3_model) and a documentation string.
Installing it
ComfyUI Manager: search Model Utility Toolkit, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-ModelUtils
Restart ComfyUI. No downloads beyond your existing model files - this is local tensor math, nothing fetched.
Where people get burned
Three-way model merging inherits the same honest tension the community has documented at length around checkpoint merging: combining models doesn't reliably combine their strengths, it tends to average them toward something blander than any single input. Adding a third source doesn't fix that - if anything it gives the merge more ways to drift from a coherent style. Use exclude_patterns deliberately if you only want one of your three models contributing a specific set of layers rather than its entire self diluted into the average.
The mechanical failure mode is the same as every merger in this pack: point it at the wrong file type (a full checkpoint instead of a bare diffusion model) and it won't behave as expected, and merging across genuinely different architectures produces garbage regardless of how carefully mismatch_mode/alignment_mode are tuned - those settings keep the math from erroring out, not from being meaningless. And three full-size diffusion models in flight is the heaviest memory ask in this pack's merger family; if lazy_load and force_clear_cache aren't enough, drop process_device to CPU and let it run slower instead of crashing.
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| execution_mode | COMBO | MERGE writes the selected result; DOCUMENTATION ONLY returns the operation reference without loading model files. | |
| model_a | COMBO | Primary diffusion model; anchors metadata, tensor shapes, and values preserved by exclusions or skip handling. | |
| model_b | COMBO | Second diffusion model contributing to the selected calculation mode. | |
| model_c | COMBO | Third diffusion model contributing to the selected three-model calculation mode. | |
| calc_mode | COMBO | Three-model operation to apply per comparable tensor; DOCUMENTATION ONLY shows its formula and coefficient meanings. | |
| mismatch_mode | COMBO | skip | Handle missing or incompatible tensors: preserve Model A, substitute zeros where supported, or abort with an error. |
| alignment_mode | COMBO | pad/crop | Resolve compatible shape differences by zero-padding/cropping or by interpolating Model B and Model C to Model A shape. |
| alpha | FLOAT | 0.50-10–10 | Mode-specific coefficient; use DOCUMENTATION ONLY for its exact role in the selected calculation mode. |
| beta | FLOAT | 0.50-10–10 | Mode-specific coefficient; some calculation modes ignore it. See DOCUMENTATION ONLY for the selected formula. |
| gamma | FLOAT | 0.50-10–10 | Mode-specific coefficient; some calculation modes ignore it. See DOCUMENTATION ONLY for the selected formula. |
| delta | FLOAT | 2.00-10–10 | Mode-specific coefficient; some calculation modes ignore it. See DOCUMENTATION ONLY for the selected formula. |
| epsilon | FLOAT | 0.01-10–10 | Mode-specific coefficient; some calculation modes ignore it. See DOCUMENTATION ONLY for the selected formula. |
| zeta | FLOAT | 0.00-10–10 | Mode-specific coefficient; some calculation modes ignore it. See DOCUMENTATION ONLY for the selected formula. |
| seed | INT | 00–18446744073709550000 | Random seed used only by calculation modes with stochastic behavior. |
| output_filename | STRING | merged_3_model | Output filename without extension, written under the matching ComfyUI model directory. |
| save_dtype | COMBO | Output tensor dtype; when Override Dtype is disabled, source tensors with higher precision remain at that precision. | |
| process_device | COMBO | Device used for per-tensor merge arithmetic; CUDA out-of-memory retries the affected tensor on CPU. | |
| exclude_patterns | STRING | Newline-separated regex or glob patterns for tensors excluded from merging and preserved from Model A. | |
| discard_patterns | STRING | Newline-separated regex or glob patterns for tensors omitted entirely from the output. | |
| glob_patterns | BOOLEAN | false | When True, exclude/discard patterns use glob syntax (* = any sequence, dots are literal). When False (default), patterns are Python regex matched as substrings. |
| lazy_load | BOOLEAN | true | Low memory mode: load tensors from disk on demand |
| force_clear_cache | BOOLEAN | true | Clear CUDA cache after each layer |
| override_dtype | BOOLEAN | false | Force the entire model to be saved as the selected save_dtype. If False (default), higher precision dtypes are preserved. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output_filename | * | — |
| documentation | STRING | — |