Scale
Turn strength into a merge parameter
- a (delta)
- alpha (1.0)
- recipe
Scale (class Scale Mecha Recipe) is the simplest merge operation in the pack and the one you'll reach for constantly once you think in deltas. It takes a delta and multiplies it by a factor. That's it. One input, one strength, one output - but it's the control that turns "how much of this change do I actually want?" into a knob you can turn anywhere in a merge graph.
Mecha's mental model separates weights (actual models) from deltas (the difference between a model and a base - the "recipe" for a change). Deltas are the unit of merge composition: Add Difference applies a delta to a base, TIES combines deltas, Model Stock averages them. Scale is how you size any of those deltas before they get combined - the difference between "apply this fine-tune fully" and "apply a third of it."
How it works
Per tensor, it's output = input * alpha, computed lazily as part of the recipe. Two short-circuits keep it fast: alpha = 0 returns a literal 0 (the delta contributes nothing), and alpha = 1 returns the delta unchanged. Everything in between is a straight multiplication, and because the whole thing is a recipe, the scaling gets folded into the merge and executed key-by-key - no intermediate files, no extra memory.
The inputs that matter:
- a (delta) (
MECHA_RECIPE, required) - the delta to scale. Note the merge space: this node expects a delta, not a full checkpoint. If you wire in weight space, validation will complain. - alpha (1.0) - the scale factor. Because it's a
MECHA_RECIPEinput, you're not limited to a single number: drive it with per-component or per-block weights from the pack'sComponents Params/Blocksnodes, and you get selective scaling - full strength on the UNet, half on the text encoder, none on the VAE. - recipe (output, delta) - the scaled delta, ready to feed
Add Difference,Add Difference Ties, or any delta consumer.
The classic pattern: Subtract Recipe List (base → model) to get a delta, Scale to size it, then Add Difference to lay it back onto a base. Want your merge 30% weaker? Change one number. Want different parts at different strengths? Swap alpha for a components param.
Install
Part of the Mecha Merge Node Pack (ljleb/comfy-mecha):
- ComfyUI Manager → Install Custom Nodes → search "mecha" → Mecha Merge Node Pack, or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ljleb/comfy-mecha.git
pip install -r comfy-mecha/requirements.txt
Restart ComfyUI; it's under mecha. The only dependency is sd-mecha==1.1.7; no model downloads.
Common issues
- Delta in, delta out. Feed Scale a checkpoint and the merge-space check refuses it. The fix is to subtract a base first - Scale operates on changes, not models.
- Alpha = 0 removes the contribution, not the key. The delta's keys still exist in the recipe; they're just multiplied by zero. Usually equivalent, occasionally not if a downstream node counts keys.
- Negative alphas are legal and mean "reverse the change." That's sometimes exactly what you want for removing a trait - just know it's on the table.
Scale is the node that makes "strength" a first-class part of your merge instead of a vibe. Once your workflow runs on deltas, this little multiply button becomes the thing you're adjusting ninety percent of the time.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a (delta) | MECHA_RECIPE | — | |
| alpha (1.0)opt | MECHA_RECIPE | 1 | — |
| merge_checkpointingopt | BOOLEAN | false | Speeds 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)
| Name | Type | Description |
|---|---|---|
| recipe | MECHA_RECIPE | — |