Nodes/Model Utility Toolkit/Merge Models (3 Models)
ComfyUI Node

Merge Models (3 Models)

Three-way blending for UNet-only diffusion models

By silveroxides·Created about a year ago·Updated 4 days ago· 14
Merge Models (3 Models)
    • output_filename
    • documentation
    execution_mode
    model_a
    model_b
    model_c
    calc_mode
    mismatch_modeskip
    alignment_modepad/crop
    alpha0.50
    beta0.50
    gamma0.50
    delta2.00
    epsilon0.01
    zeta0.00
    seed0
    output_filenamemerged_3_model
    save_dtype
    process_device
    exclude_patterns
    discard_patterns
    glob_patternsfalse
    lazy_loadtrue
    force_clear_cachetrue
    override_dtypefalse

    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.

    CategoryModelUtils/Merging

    Inputs (23)

    NameTypeDefaultDescription
    execution_modeCOMBO2 options: MERGE, DOCUMENTATION ONLY
    model_aCOMBO1 options: None
    model_bCOMBO1 options: None
    model_cCOMBO1 options: None
    calc_modeCOMBO4 options: Add-Difference, Train-Difference, Extract-Features, Add-Dissimilarities
    mismatch_modeCOMBOskip3 options: skip, zeros, error
    alignment_modeCOMBOpad/crop2 options: pad/crop, interpolate
    alphaFLOAT0.50-10–10
    betaFLOAT0.50-10–10
    gammaFLOAT0.50-10–10
    deltaFLOAT2.00-10–10
    epsilonFLOAT0.01-10–10
    zetaFLOAT0.00-10–10
    seedINT00–18446744073709550000
    output_filenameSTRINGmerged_3_model
    save_dtypeCOMBO3 options: fp32, fp16, bf16
    process_deviceCOMBO2 options: cuda, cpu
    exclude_patternsSTRING
    discard_patternsSTRING
    glob_patternsBOOLEANfalseWhen True, exclude/discard patterns use glob syntax (* = any sequence, dots are literal). When False (default), patterns are Python regex matched as substrings.
    lazy_loadBOOLEANtrueLow memory mode: load tensors from disk on demand
    force_clear_cacheBOOLEANtrueClear CUDA cache after each layer
    override_dtypeBOOLEANfalseForce the entire model to be saved as the selected save_dtype. If False (default), higher precision dtypes are preserved.

    Outputs (2)

    NameTypeDescription
    output_filenameSTRING
    documentationSTRING