Elemental Matrix Merge (Knobs)
Model merging, played like a synthesizer
- model1
- model2
- model
- report
Elemental Matrix Merge (Knobs) is the "feel it out" node of the ComfyUI-RecipeMerge pack. Where the recipe node makes you type, this one gives you a synth panel - a matrix of knobs, one per block per element, and you twist until the image looks right. It's the most immediately satisfying way to do a selective checkpoint merge in ComfyUI, and the only one that starts you in a safe place: every knob begins at 0, meaning model1 completely unchanged. Nothing happens until you deliberately turn something up.
It's laid out the MBW way: IN blocks down the left (IN00–IN11), OUT blocks down the right (OUT00–OUT11), BASE and M00 along the bottom. Each column is an element - attn1 (self-attention), attn2 (cross-attention, your prompt response), ff (texture), norm, proj, and other, which covers every key in the block that isn't one of those (conv layers etc.). A knob's value is model2's share of that block+element: 0 = model1's weight, 1 = model2's. Same direction as SuperMerger's alpha, the reverse of ComfyUI's ModelMergeSimple - the usual source of "why is my merge backwards" confusion.
Sub-elements, tabs, and the controls you'll actually use
Click an element tab (attn1, attn2, ff, …) and the matrix zooms in on that element with a sub-element column: to_q/to_k/to_v/to_out under the attn tabs, net.0/net.2 under ff, norm1–norm3, proj_in/proj_out, and the other sub-keys. A sub-knob at 0 follows its parent; the moment you set it non-zero it overrides the parent for that sub-key, and the tab gets a • so you remember you overrode something.
Twist a knob by dragging up/down, double-click to zero it, scroll-wheel for fine ±0.05 steps. The toolbar buttons are straightforward: SET 0 / SET 0.5 / SET 1 nudge every parent knob in the current tab (they leave sub-knobs alone), and SUB 0 clears the current tab's sub-element overrides back to "follow parent."
Presets and sharing - the real killer feature
The preset dropdown under the tab bar saves and reloads the whole matrix, and it lives in ComfyUI's user/ data - not the workflow - so it survives node deletion and moves between machines. SAVE stores the current knobs, DEL removes one. The starred entries are bundled classic MBW curves - FLAT_25/50/75, GRAD_V, GRAD_A, COS_IN, COS_OUT, WRAP08 - all with BASE at 0 (they're MBW transplants). EXP writes the current preset (or the current knobs) to a JSON file, IMP imports one and applies it, and you can also just drag a preset JSON onto the node to load it. Two sample presets ship in presets/: body2_face1_SDXL.json (deep blocks to model2 for "body from 2, face from 1") and a faceguard variant that zeroes attn1/attn2 so the face doesn't get dragged toward model2.
The share format is deliberately boring: {"type":"recipe_merge_matrix_preset","version":1,"name":"...","matrix":{"IN07":{"attn1":0.8,...}}} (or the bare {"IN07":{...}} form). Only valid block names (IN00–IN11, M00, OUT00–OUT11, BASE) and numeric values are accepted - everything else is ignored, so a shared preset is pure numeric data and can't execute code. That's why it's safe to drag strangers' presets onto your graph.
Inputs, outputs, install
Inputs are model1, model2, and a hidden matrix STRING widget that the knob UI writes as JSON - you can hand-edit it if you're into that, but you won't need to. Outputs: model and report (the per-rule key counts; read it to catch rules that matched nothing - e.g. OUT09+ don't exist on SDXL).
Install is the pack-standard: ComfyUI Manager (search "ComfyUI-RecipeMerge") or
cd ComfyUI/custom_nodes
git clone https://github.com/galigali-san/ComfyUI-RecipeMerge
then restart. No extra Python dependencies. UI labels are Japanese for now.
Watch for: the default-0 safety (a fresh node won't surprise you), the reversed ratio direction vs ModelMergeSimple, and the license check before you redistribute anything you merge - merges inherit their parents' restrictions, and the report/metadata story is the same as the pack's other nodes (recipe embedded via CheckpointSave, strip with --disable-metadata). If you'd rather type than twist, the sibling Elemental Merge (Recipe) node is this same engine with a text interface.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model1 | MODEL | — | |
| model2 | MODEL | — | |
| matrix | STRING | {} | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| report | STRING | — |