Nodes/Mecha Merge Node Pack/Subtract Recipe List
ComfyUI Node

Subtract Recipe List

Turn a pile of models into deltas in one step

By ljleb·Created 3 years ago·Updated about a month ago· 101
Subtract Recipe List
  • base_recipe
  • recipe_0
  • recipe_1
  • recipe_2
  • recipe_3
  • recipe_4
  • recipe_5
  • recipe_6
  • recipe_7
  • recipe_8
  • recipe_9
  • recipe_10
  • recipe_11
  • recipe_12
  • recipe_13
  • recipe_14
  • recipe_15
  • recipe_16
  • recipe_17
  • recipe_18
  • recipe_19
  • recipe_20
  • recipe_21
  • recipe_22
  • recipe_23
  • recipe_24
  • recipe_25
  • recipe_26
  • recipe_27
  • recipe_28
  • recipe_29
  • recipe_30
  • recipe_31
  • recipe_32
  • recipe_33
  • recipe_34
  • recipe_35
  • recipe_36
  • recipe_37
  • recipe_38
  • recipe_39
  • recipe_40
  • recipe_41
  • recipe_42
  • recipe_43
  • recipe_44
  • recipe_45
  • recipe_46
  • recipe_47
  • recipe_48
  • recipe_49
  • recipe_50
  • recipe_51
  • recipe_52
  • recipe_53
  • recipe_54
  • recipe_55
  • recipe_56
  • recipe_57
  • recipe_58
  • recipe_59
  • recipe_60
  • recipe_61
  • recipe_62
  • recipe_63
  • recipes
count2

The Subtract Recipe List (class Mecha Subtract Recipe List) is the version of the pack's Mecha Recipe List that actually does the math for you. Where the plain list node just bundles recipes together, this one takes a base_recipe and subtracts it from every recipe you feed in - so what comes out the other side is a list of deltas, all measured from the same base.

If you've done any serious merging, you know the drill: "fine-tune A minus base, fine-tune B minus base, then combine the deltas." This node is that setup minus the repetitive plumbing.

How it works

Mecha keeps two merge spaces straight: weights (full checkpoints, meaning "the actual model") and deltas (the difference between a model and something else). Subtracting a base from a model is the canonical way to get a delta - it's what add_difference style merges consume. Under the hood this node does exactly what Mecha Recipe List does, but for each recipe_i it computes recipe_i.node - base_recipe.node, so you never wire up the same subtraction graph over and over.

The inputs that matter:

  • count (INT, default 2, 0–64) - how many of the recipe slots actually get collected into the output list. Bump this to match how many deltas you're building.
  • base_recipe (MECHA_RECIPE, required) - the common model every other input is measured against.
  • recipe_0 … recipe_63 (MECHA_RECIPE, optional) - the models to subtract the base from. Fill only as many as count.
  • recipes (MECHA_RECIPE_LIST, output) - the resulting list of deltas, in the same order.

That output is a MECHA_RECIPE_LIST, which is the input type for every "n-way" merge method in the pack - Add Difference Ties, N Average, Model Stock, and friends. So a typical chain is: base + four fine-tunes → Subtract Recipe List → a TIES/DARE node → add the base back → Mecha Merger.

Install

Same pack, same install as everything else here. ComfyUI Manager → search "mecha" → install Mecha Merge Node Pack - or:

cd ComfyUI/custom_nodes
git clone https://github.com/ljleb/comfy-mecha.git
pip install -r comfy-mecha/requirements.txt

Restart, and the node shows up under mecha. The pack's only dependency is sd-mecha==1.1.7; no model files are downloaded by the pack itself.

Common issues

  • count is the master switch. Set count to 3 but only wire recipe_0 and recipe_1, and you get a two-element list, not an error. Set it to 4 with only three wired and same thing. It's a convenience, but it can bite you when you expect "n" and get "n-1."
  • The output is a list of deltas, not models. Whatever consumes this list is expected to work in delta space. If a downstream node complains about merge space, you've plugged a delta into a weight input (or vice versa) - the validation error usually spells this out, and the fix is to re-add the base somewhere down the chain.
  • All recipes should be compatible with the base. If you subtract a base that doesn't share keys with one of the inputs, sd-mecha will let you know the recipe can't be built. Use models from the same family.

If your workflow is "one base, several experiments, all measured against it," this is the node that keeps the graph small enough to actually see what you're doing.

Categorymecha

Inputs (66)

NameTypeDefaultDescription
countINT20–64
base_recipeMECHA_RECIPE
recipe_0optMECHA_RECIPE
recipe_1optMECHA_RECIPE
recipe_2optMECHA_RECIPE
recipe_3optMECHA_RECIPE
recipe_4optMECHA_RECIPE
recipe_5optMECHA_RECIPE
recipe_6optMECHA_RECIPE
recipe_7optMECHA_RECIPE
recipe_8optMECHA_RECIPE
recipe_9optMECHA_RECIPE
recipe_10optMECHA_RECIPE
recipe_11optMECHA_RECIPE
recipe_12optMECHA_RECIPE
recipe_13optMECHA_RECIPE
recipe_14optMECHA_RECIPE
recipe_15optMECHA_RECIPE
recipe_16optMECHA_RECIPE
recipe_17optMECHA_RECIPE
recipe_18optMECHA_RECIPE
recipe_19optMECHA_RECIPE
recipe_20optMECHA_RECIPE
recipe_21optMECHA_RECIPE
recipe_22optMECHA_RECIPE
recipe_23optMECHA_RECIPE
recipe_24optMECHA_RECIPE
recipe_25optMECHA_RECIPE
recipe_26optMECHA_RECIPE
recipe_27optMECHA_RECIPE
recipe_28optMECHA_RECIPE
recipe_29optMECHA_RECIPE
recipe_30optMECHA_RECIPE
recipe_31optMECHA_RECIPE
recipe_32optMECHA_RECIPE
recipe_33optMECHA_RECIPE
recipe_34optMECHA_RECIPE
recipe_35optMECHA_RECIPE
recipe_36optMECHA_RECIPE
recipe_37optMECHA_RECIPE
recipe_38optMECHA_RECIPE
recipe_39optMECHA_RECIPE
recipe_40optMECHA_RECIPE
recipe_41optMECHA_RECIPE
recipe_42optMECHA_RECIPE
recipe_43optMECHA_RECIPE
recipe_44optMECHA_RECIPE
recipe_45optMECHA_RECIPE
recipe_46optMECHA_RECIPE
recipe_47optMECHA_RECIPE
recipe_48optMECHA_RECIPE
recipe_49optMECHA_RECIPE
recipe_50optMECHA_RECIPE
recipe_51optMECHA_RECIPE
recipe_52optMECHA_RECIPE
recipe_53optMECHA_RECIPE
recipe_54optMECHA_RECIPE
recipe_55optMECHA_RECIPE
recipe_56optMECHA_RECIPE
recipe_57optMECHA_RECIPE
recipe_58optMECHA_RECIPE
recipe_59optMECHA_RECIPE
recipe_60optMECHA_RECIPE
recipe_61optMECHA_RECIPE
recipe_62optMECHA_RECIPE
recipe_63optMECHA_RECIPE

Outputs (1)

NameTypeDescription
recipesMECHA_RECIPE_LIST