Diff → Recipe (auto-merge)
Turn a model diff into a merge recipe you can actually run
- recipe
- info
Blind merging is a gamble. You throw two checkpoints together at some ratio and hope the good parts of each survive - which is exactly how most of the merges on CivitAI got made, and why so many of them converge on the same average-looking output. Diff → Recipe (auto-merge) is the antidote: it reads the diff heatmap from its sibling Model Diff Viewer and writes a merge recipe that only blends the parts that are actually different. Instead of merging everything, you merge just the deltas.
It's one of three SDXL analysis nodes in galigali-san/ComfyUI-ModelDumpster (the author's experimental grab-bag - MIT-licensed, zero install dependencies). The "recipe" concept will be familiar if you ever used A1111's merge tab or read a CivitAI model card: a plain-text list of which weights get blended at what strength. What this node does is generate that list for you, from measured data instead of vibes.
How the recipe is built
You wire it to the output of Model Diff Viewer, and it does three things with the diff matrix:
threshold(default 0.3) - only block×element cells whose diff is at or above this get any ratio at all. Below it, the models agree there, so why touch them? Raise it and the recipe gets shorter and more surgical; drop it and you start merging noise.ratio(default 0.5) - how hard each selected cell gets pulled towardmodel2. 0.5 is "meet in the middle"; 1.0 is "take model2's version wholesale."scale_by_diff(default off) - when on, the ratio is scaled proportionally to how big the diff is, so the most-divergent parts get merged hardest. Nice idea, and it defaults off for good reason: it makes recipes harder to reason about.
The output is a text recipe: a 0.0 base line (everything not listed stays untouched) plus one BLOCK:element:ratio line per qualifying cell - IN04:attn2:0.500, that sort of thing. The other element is skipped entirely, because it's structural layers that have no merge token. The second output, info, just tells you how many lines were generated so you can sanity-check that the recipe isn't empty or bloated.
Wiring it up
The intended pipeline, straight from the README:
Model Diff Viewer → Diff → Recipe → (RecipeMerge) Elemental Merge (Recipe) → CheckpointSave
Note the parenthetical: the merge itself isn't in this pack. Diff → Recipe only writes the recipe string. To execute it you need ComfyUI-RecipeMerge by the same author, whose Elemental Merge (Recipe) node takes the recipe as its input. Install that separately, or treat the recipe as a spec you execute in any tool that understands per-key merge weights.
Installing it
No dependencies, no model files to download:
cd ComfyUI/custom_nodes
git clone https://github.com/galigali-san/ComfyUI-ModelDumpster
Then restart ComfyUI. Or use ComfyUI Manager and search for ComfyUI-ModelDumpster. You'll find the node under advanced/model_analysis. If you want the merge half of the pipeline to work, clone ComfyUI-RecipeMerge the same way.
Common issues
- It has to be wired, not typed.
heatmap_jsonis aforceInputsocket - you must connect it from Model Diff Viewer. There's no meaningful way to hand-write this payload, so if the node errors on unreadable JSON, the wire's missing or stale. - Threshold too low → recipe bloat. At 0.1, almost every cell qualifies and you're back to a near-full merge, which defeats the purpose. Keep it above the "noise floor" of your diff.
- Threshold too high → empty recipe. If the models genuinely differ a lot everywhere, nothing passes and you merge nothing. Read the diff report first; this node is only as smart as the threshold you set.
- SDXL only, like its sibling - the block layout assumes the SDXL UNet.
The honest take: this is the payoff node of the pack. Model Diff Viewer alone is a curiosity; Diff → Recipe turns it into something actionable - a merge you can point to and say "I blended exactly these five cells, and left the rest alone." For a niche experimental tool, that's a real workflow.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| heatmap_json | STRING | — | |
| threshold | FLOAT | 0.300–1 | この差分以上のブロック×要素だけをマージ対象にする |
| ratio | FLOAT | 0.500–1 | 対象を model2 へ寄せる比率 |
| scale_by_diff | BOOLEAN | false | ONで比率を差分の大きさに比例 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| recipe | STRING | — |
| info | STRING | — |