Batch LoRa apply
Render every LoRA in a folder in one queue
- model
- clip
- model_strength
- clip_strength
- stack
- model
- clip
- stack
You've just downloaded ten LoRAs that might fit your workflow and you want to see them side by side, same seed, same prompt. The manual way is ten copies of the workflow with ten different LoraLoader nodes. Batch LoRa apply from More Math does it in one node: it points at a folder, applies every LoRA in it to your model and CLIP, and outputs a list of patched models for batch processing. It's the node I'd build this pack around if I only had one feature to ship.
How it works
Give it a model and a clip, point folder at a subfolder inside your LoRA directory, and the node iterates the LoRAs in it, applying each one to produce a patched model+clip pair. The model_strength and clip_strength fields are expressions, not fixed numbers - the defaults are [1.0] (a list literal), and that's the whole point: you can supply a list of strengths, one per LoRA, or compute them with the pack's expression language. You can even reference lora_names and lora_count inside the expression if you want strengths derived from the LoRA list itself. add_no_lora adds a baseline entry with no LoRA applied - which is how you get your "control" render in the same batch, and honestly you should always turn that on for comparisons.
Inputs and outputs
Required: model, clip, folder (the subfolder containing the LoRA weights), add_no_lora, model_strength, clip_strength. Optional stack. Outputs are model (a list - one per LoRA), clip (list, matching), and stack. Feed those lists into your batch machinery and render the whole folder in one queue.
Installing it
Identical to the rest of the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/mcDandy/more_math
cd more_math
pip install -r requirements.txt
Restart ComfyUI, or install "More math" from ComfyUI Manager. Dependency is antlr4-python3-runtime on top of torch. The LoRAs themselves are yours - drop them in your LoRA folder, point folder at the subfolder name.
Gotchas
The strength fields expect list syntax - [1.0] applies 1.0 to every LoRA, [1.0, 0.5, 0.75] applies one strength per LoRA and will misbehave if the counts don't line up. Keep the folder scoped: put only the LoRAs you want to compare in one subfolder, or every render you queue gets one model per file, and a folder with 40 LoRAs means 40 generations. And because model patching is CPU-side work, applying a large batch of LoRAs adds real setup time before sampling starts. New pack, solo-maintained, but the concept is simple and it does exactly what it says - if you A/B test LoRAs at all, this is a time-saver you'll use constantly.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model to apply the LoRA weights to | |
| clip | CLIP | The clip to apply the LoRA weights to | |
| folder | STRING | The sub-folder containing the LoRA weights | |
| add_no_lora | BOOLEAN | Whether to add a model execution without a lora | |
| model_strength | STRING,SYNTAX_TREE | [1.0] | strength of lora applied to model |
| clip_strength | STRING,SYNTAX_TREE | [1.0] | strength of lora applied to clip |
| stackopt | STACK | The stack |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | MODEL | The model with the LoRA weights applied |
| clip | CLIP | The clip with the LoRA weights applied |
| stack | STACK | The stack |