Nodes/ComfyUi-MpiNodes/Mpi Lora Switch
ComfyUI Node

Mpi Lora Switch

Pick one of five LoRAs by number — or by seed

By MadPonyInteractive·Created 11 months ago·Updated 5 days ago· 3
Mpi Lora Switch
    • lora_name
    • index
    select1
    lora_name_1
    lora_name_2
    lora_name_3
    lora_name_4
    lora_name_5

    Five LoRA slots, one selector, one name out. Mpi Lora Switch is the "which LoRA am I using right now?" node - it routes a choice between up to five LoRA files by an index. And here's the part to get straight before anything else: it outputs a name, not a patched model. You feed the output into Mpi Lora Model or Mpi Lora Model Clip, and that node does the actual application. The switch is the selector; the loader is the executor. Confusing those two is the single most common misunderstanding of this node.

    Inputs: select, an INT from 1 to 5 (default 1) - the tooltip is explicit that both the selection and the output index are 1-based - and five dropdowns lora_name_1 through lora_name_5, each built from your loras/ folder with None available first. Outputs: lora_name (the chosen file) and index (echoes which slot won, so a downstream node can log or branch on it). The slots are lazy, meaning only the selected input gets evaluated - you can park expensive-to-resolve names in the other four without paying for them.

    Where this earns its keep is automation. The select input can be a wire rather than a typed number, which means anything that produces an INT upstream can drive it: an MpiIfElse branch, a math result, or a seed pick. Wire an MpiIfElseProbability's boolean into a node that converts it to a 1/2 index, and suddenly your workflow rolls a LoRA at random each run - deterministic for a given seed, rerolled on a new one. That's the "pick by seed" workflow in the title, and it's a genuinely nice way to A/B-test styles: load two or three style LoRAs, randomize the pick, and let runs explore.

    It's built on the pack's generic switch base (MpiAnySwitch is the same shape with any-type inputs; this one is typed to LoRA names), and it shares the 1-based indexing of the family - don't start counting from 0, because the node won't. If you find yourself switching between exactly two LoRAs constantly, a plain MpiIfElse feeding a couple of Mpi Lora Model nodes does the same job with less machinery; the switch earns its keep at three-plus options or when the choice is computed rather than manual.

    Install is the pack's standard no-drama story: ComfyUI Manager → search "ComfyUi-MpiNodes" → install → restart, or

    cd ComfyUI/custom_nodes
    git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
    

    No dependencies; just your LoRA files in ComfyUI/models/loras/. Part of the Mad Pony Interactive utility pack (engine behind Cubric Vision). Remember the contract - name out, apply elsewhere - and it's a clean little routing valve for any multi-LoRA workflow.

    CategoryMpiNodes/Logic

    Inputs (6)

    NameTypeDefaultDescription
    selectINT11–5Selection from 1 to 5 Output index is also 1 to 5
    lora_name_1COMBO1 options: None
    lora_name_2COMBO1 options: None
    lora_name_3COMBO1 options: None
    lora_name_4COMBO1 options: None
    lora_name_5COMBO1 options: None

    Outputs (2)

    NameTypeDescription
    lora_name*
    indexINT