Scale LoRA (Batch)
Rescale LoRA strengths after the fact, one value per batch item
- model
- clip
- model_strength
- clip_strength
- stack
- model
- clip
- stack
Scale LoRA (Batch) does something most LoRA nodes can't: it takes a model that already has LoRA injections loaded and produces a list of models, each with those injections scaled by a different strength. Feed it strengths [1.0, 0.8, 0.5, ...] and you get back one model per strength - which is how you do per-frame or per-batch LoRA schedules, like a style that fades in across a video. It works with the pack's own batch LoRA node, or with the core "Load LoRA (Bypass) (For Debugging)" loader.
How it works
LoRAs are patches, and ComfyUI's bypass LoRA mechanism is a set of hooks injected into the model that can be re-scaled after loading. This node digs those bypass hooks out of the model's patcher, deep-copies them, multiplies each hook's multiplier by your scale, and rebuilds the injection - once per strength in your list. It then does the same for the clip side. The output is a list of model/clip pairs that match the length of your strengths list.
The strengths fields accept the pack's expression language, so [1.0, 0.8, 0.5] is just a list literal - no per-item wiring, and the list is the schedule. You could also build the list from a script or a computation rather than typing values by hand.
The inputs that matter
model- the model with bypass LoRA injections already applied.clip- the matching clip with bypass LoRA injections.model_strength- a list of model-side strengths, default[1.0].clip_strength- a list of clip-side strengths, default[1.0].stack- optional, the pack's shared stack state.
Outputs: model (a list), clip (a list), and stack. The lists are the point - wire them into something that iterates per frame or per batch item.
Installing it
Part of More Math (mcDandy/more_math). ComfyUI Manager - search "More Math" - or:
cd ComfyUI/custom_nodes
git clone https://github.com/mcDandy/more_math
cd more_math
pip install -r requirements.txt
Restart. Dependencies are just antlr4-python3-runtime and torch - no model files. It targets a current ComfyUI (newer node API), so update ComfyUI if the nodes don't register.
Where people get burned
Two real traps here.
First, this node does nothing if there are no bypass LoRA injections to scale. There's no error - you just get back the model unchanged, which reads as "the node is broken" until you realize the LoRA wasn't loaded in bypass mode. Make sure you loaded it with "Load LoRA (Bypass) (For Debugging)" or the pack's batch LoRA node, not the normal loader.
Second, the two strength lists must be the same length - a mismatch raises a ValueError telling you exactly how many each had. Count your list items, because the error is the feature here.
Beyond that, this is deep-end territory: it exists for LoRA schedules (fade in, per-segment strengths, animated style weights), which most users never need. If that's not you, the rgthree Power LoRA Loader or a simple per-batch workflow will serve you better - but when you do need per-batch LoRA strength, there aren't many nodes that pull it off, and this one is the pack's answer.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model with bypass LoRA injections | |
| clip | CLIP | The clip with bypass LoRA injections | |
| model_strength | STRING,SYNTAX_TREE | [1.0] | List of model-side LoRA strengths |
| clip_strength | STRING,SYNTAX_TREE | [1.0] | List of clip-side LoRA strengths |
| stackopt | STACK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | MODEL | The model with scaled bypass LoRA injections |
| clip | CLIP | The clip with scaled bypass LoRA injections |
| stack | STACK | The stack |