Nodes/Mecha Merge Node Pack/Multiply Quotient
ComfyUI Node

Multiply Quotient

The weird interpolation node nobody tells you about (and why it exists)

By ljleb·Created 2 years ago·Updated 30 days ago· 101
Multiply Quotient
  • a (delta|param|weight)
  • b (delta|param|weight)
  • c (delta|param|weight)
  • alpha (1.0)
  • recipe
merge_checkpointingfalse

Multiply Quotient (class Multiply Quotient Mecha Recipe) is one of those merge methods that looks like a typo until you stare at the math. It takes three inputs - a, b, and c - and produces a blend that interpolates b and c relative to a, but along a log-scale quotient instead of the plain linear lerp you're used to.

Weighted sum gives you lerp(a, b, alpha). Multiply Quotient gives you, per weight:

result = a * (b / c) ** alpha

with the exponent clamped based on how far both b and c are from a in log space. The idea: instead of "move a fraction of the way from a to b," it says "scale a by the ratio between b and c, raised to a strength." It's a genuinely different notion of blending - multiplicative rather than additive - and it's useful in exactly the situations where a lerp produces muddy, washed-out merges.

How it works

Under the hood (in sd-mecha's linear.py) the method computes log differences between a and c, and between b and c, then uses their product to clamp alpha. If the interpolation would produce a NaN - which happens when ratios go negative or zero - it falls back to returning a unchanged for that tensor. So a stray degenerate weight won't poison the whole merge; you just get the unmodified value there.

The inputs that matter:

  • a, b, c (all MECHA_RECIPE, required) - the three models or deltas. Order matters: a is the anchor, and the blend interpolates the b-to-c direction through it.
  • alpha (1.0) - the interpolation strength. 0 gives you back a; 1 applies the full quotient. Since it's a MECHA_RECIPE input, you can drive it with per-component or per-block weights from the pack's Components Params / Blocks nodes instead of a single float.
  • recipe (output, weight space) - goes wherever a normal merged model would go: straight into Mecha Merger, or into a larger recipe.

Honest take: this is a specialist tool. Most people will never need it, and for ordinary "mix style A and style B" work a weighted sum or Add Difference is the right call. Where Multiply Quotient earns its keep is when you're chasing a specific blend that linear interpolation keeps flattening out - think combining deltas with very different magnitudes, where ratios preserve structure that differences destroy. It's also a favorite in the sd-mecha Discord's "chaos lab" for exactly that reason: it's one of the methods you reach for when everything linear has failed.

Install

Same pack as all the mecha nodes - Mecha Merge Node Pack (ljleb/comfy-mecha):

  • ComfyUI Manager → Install Custom Nodes → 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 ComfyUI. Only dependency is sd-mecha==1.1.7; no downloads.

Common issues

  • NaN outputs mean a degenerate ratio, not a crash. The node handles it internally, but if your result looks "blocky," check whether any of the three inputs have near-zero or negative weights in the affected region.
  • Input order is everything. Swapping b and c flips the interpolation direction - the output will be subtly different and equally "valid." If a result doesn't match your notes, check your wiring first.
  • It expects weight-space values. Unlike Scale or Model Stock, this isn't a delta operation - feed it recipes that represent actual models or already-merged results.

Think of Multiply Quotient as a hidden second gear. You won't use it every day, but when a merge "just won't take," it's one of the few moves that actually changes the shape of the problem instead of pushing the same knob harder.

Categorymecha

Inputs (5)

NameTypeDefaultDescription
a (delta|param|weight)MECHA_RECIPE
b (delta|param|weight)MECHA_RECIPE
c (delta|param|weight)MECHA_RECIPE
alpha (1.0)optMECHA_RECIPE1
merge_checkpointingoptBOOLEANfalseSpeeds up an entire branch of a merge graph that does not change often in exchange of memory. - true: store the first output of this recipe node on cpu memory in fp16. On subsequent workflow executions, as long as the inputs do not change, the cached keys are returned after being cast to the original device and dtype. - false: do not store the output. The recipe and its inputs will re-execute on subsequent workflow executions. Note that the memory used to checkpoint the output is distinct from the cache feature. In general, you probably want to either use this *or* a cache unit, but not both at the same time because the memory adds up. The difference between merge checkpointing and cache is that merge checkpointing completely re-merges from scratch if any input changes. Merge checkpointing is also generally much faster than cache in the fast path.

Outputs (1)

NameTypeDescription
recipeMECHA_RECIPE