Mpi Style Loras
Five LoRA slots that only fire on their matching style
- style
- style
- model
- clip
- prompt
LoRA stacks are how modern workflows handle style, but hardwiring five LoRA loaders in a row means all five apply at once - which is usually not what you want. MpiStyleLoras is the selective version: a bank of five LoRA slots that applies only the one matching the active style, then passes the model, clip, and the style's trigger words through. It's the execution half of the pack's style-router pair, designed to sit after MpiStyleSelector.
The idea: your workflow wants one of several named styles - "watercolor," "cyberpunk," "studio portrait" - chosen by a single selector integer. Each style is a LoRA plus a trigger phrase. This node holds five of those pairs (one LoRA per slot) and only loads the one the selector points at. Leave a slot at None and that style becomes prompt-only - trigger words with no LoRA, which is a perfectly valid lightweight style.
How chaining works - the part that's easy to miss
Each bank claims five consecutive selector values automatically. The first MpiStyleLoras answers to selector 1–5; wire a second bank into its style output and it answers to 6–10; a third to 11–15. The chain walks the first_slot forward through each bank, so you can stack styles far past five without ever telling a bank which numbers it owns. The source is careful about one detail: a bank always claims its five slots even when some are None, so emptying a slot in an early bank never shifts the indexes of a later one.
The active LoRA is loaded through ComfyUI's own load_lora_for_models with the strength_model/strength_clip that came down the MPI_STYLE wire, and a slot at None (or a zero strength) is skipped entirely - no LoRA math, no model churn.
The inputs that matter
- style - the
MPI_STYLEbundle fromMpiStyleSelector. Non-negotiable; this is what tells the bank which slot to fire. - lora_1 … lora_5 - dropdowns populated from your
models/lorasfolder, defaultNone. These are the style LoRAs; slot N pairs with style N (selector line N).
Outputs: style (the bundle, updated), model, clip, and prompt (the trigger words for the active style). Wire model/clip onward and concatenate prompt into your positive prompt.
Install
Part of ComfyUi-MpiNodes. ComfyUI Manager (search "MpiNodes" / publisher "mad-pony-interactive"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
Restart. No extra deps - but the dropdowns are only useful once your style LoRAs are sitting in models/loras.
Where people trip
The numbering contract is the whole game: style line 1 pairs with lora_1 of the first bank, style line 6 with lora_1 of the second bank. Keep the triggers line order in MpiStyleSelector in lockstep with the slots or you'll apply the wrong LoRA to the right trigger and swear the model is broken. And remember the strengths come from the selector, not this node - if a LoRA never seems to apply, check strength_model/strength_clip upstream. If you want a style with zero LoRA applied, None is the honest answer, and it saves you the LoRA load.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| style | MPI_STYLE | — | |
| lora_1 | COMBO | 1 options: None | |
| lora_2 | COMBO | 1 options: None | |
| lora_3 | COMBO | 1 options: None | |
| lora_4 | COMBO | 1 options: None | |
| lora_5 | COMBO | 1 options: None |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| style | MPI_STYLE | — |
| model | MODEL | — |
| clip | CLIP | — |
| prompt | STRING | — |