Model Mixer
Merge two checkpoints without leaving your workflow
- model_a
- model_b
- MODEL
Model merging normally means firing up a merge script outside ComfyUI, waiting for a file, and reloading it. Model Mixer does the merge in the graph, live: load two checkpoints, pick a ratio, and the output MODEL is a blend you can sample immediately. It's the checkpoint equivalent of grabbing two colors and mixing them on the palette instead of going back to the store. For anyone who's ever wanted a "60% checkpoint A, 40% checkpoint B" that they can re-tune mid-session, this is the node.
How it works
It clones model A, then walks both models' named_parameters() and, wherever the names and shapes match, sets the result to (1 - mix_ratio) * A + mix_ratio * B. mix_ratio 0 gives you all A, 1 gives you all B. That's the core mechanic, and it's exactly the kind of "weighted average of existing models" interpolation the community has been doing since the dawn of merging - see the "merging" section of any half-decent concepts explainer for the usual caveats about coherence and the convergence problem.
Here's the honest part, and you should read it before you build a workflow on the dropdown: the shipped code only implements linear_interpolation. The other four modes - weighted_sum, layer_wise_mix, frequency_blend, and random_mix - are declared in the dropdown but not wired up yet. Pick one and you'll get back an unmodified clone of model A and no error. The README advertises all five blend modes; the code, at version 0.0.1, hasn't caught up. It's a textbook README-vs-code divergence, so check the repo's current state if this matters to you - it may be fixed by the time you read this.
The inputs that matter
model_a/model_b- the twoMODELs, each from a checkpoint loader.mix_mode-linear_interpolation. For now, genuinely, the only one that does anything.mix_ratio- 0 to 1, your blend point.
Output is a MODEL, straight into a KSampler. Because it clones model A in memory and mutates the clone, your original checkpoints stay untouched on disk - nothing is saved unless you save it.
Installing it
From DavidPiazza/network_bending - ComfyUI Manager ("Network Bending") or:
cd ComfyUI/custom_nodes
git clone https://github.com/DavidPiazza/network_bending.git
Restart, and you're done; no pip requirements for the core nodes.
Where people get tripped up
Two things. First, expect model_b and model_a to be the same architecture - the node matches parameters by name and shape, and if they don't match, those parameters just aren't mixed. Blending an SDXL and an SD1.5 model isn't a merge, it's a lottery. Second, and more important: if you've loaded a "mix_mode" that isn't linear_interpolation, you will see no change and no error, which is the worst kind of bug to debug. Start with linear, and if a fancier mode matters to you, that's a signal to check the repo's issue tracker before trusting it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model_a | MODEL | First model | |
| model_b | MODEL | Second model | |
| mix_mode | COMBO | linear_interpolation | 5 options: linear_interpolation, weighted_sum, layer_wise_mix, frequency_blend, random_mix |
| mix_ratio | FLOAT | 0.500–1 | 0 = 100% model A, 1 = 100% model B |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |