Lora Enum Switch 10X (Soze)
A LoRA Loader That Picks One of Ten by a String — The Batch-Workflow Unclogger
- model
- clip
- MODEL
- CLIP
- lora_name
- matched_index
- status
LoRA switching is the classic ComfyUI spaghetti problem. You want to A/B ten different LoRAs, or you want a CSV-driven batch where each row applies a different style, and your first instinct is a wall of LoraLoaders connected to a switch. Lora Enum Switch 10X is the sane version: one loader, ten slots, and a single string decides which LoRA actually gets applied.
Here's how it thinks. You feed it a base model and clip, plus a string called enum_value. That string is matched against ten compare_text_N labels - case-insensitive and whitespace-trimmed by default, with case_sensitive and strip_whitespace toggles if you need strict matching. Whichever slot's label matches wins, and only that LoRA is loaded and applied. No match? Clean passthrough: you get your base model back untouched, which is much nicer than a hard failure mid-batch.
The matching runs against each model_N dropdown (populated from your models/loras folder) paired with its label, so the wiring is: pick a LoRA in dropdown N, type a matching label in compare_text_N, and drive enum_value from anywhere - an XY plot, a CSV reader, a JSON node, another string node. The pack ships a little JS button, "Copy Names to Compare Text," that fills the labels from your dropdowns and copies the populated list to your clipboard as a JSON array. Paste that array into a JSON iterator upstream and your enum_value just walks the list. That's the whole batch pattern in two clicks.
Other inputs worth knowing: strength_model and strength_clip (default 1.0, negatives allowed) apply to whatever LoRA matches. And there's a genuinely useful allow_none toggle: when on, an enum_value of none (which the copy button preps as the first array item) skips loading entirely and passes (model, clip) straight through. It's how you get "this row, no LoRA" as a first-class option in a sweep.
Outputs: the usual MODEL and CLIP (the LoRA-applied ones), plus lora_name so you know which file actually got used, a 1-based matched_index (0 = no match) for downstream logic, and a status string that tells you what matched and what happened.
When to reach for it
This is a batch-workflow node, not a daily-driver. Reach for it when you're sweeping LoRAs against checkpoints (the pack's CSV Reader X Lora variant does exactly this pairing), or when a single enum_value from a dropdown should decide which style a whole graph applies. If you only ever load one LoRA by hand, the stock LoraLoader is fine. If your graph is deciding between ten of them at runtime, this is the node that stops you from building a switch tower.
Install & gotchas
cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt
No API keys, no model downloads - it reuses ComfyUI's own LoraLoader under the hood. The trap is matching discipline: labels are matched verbatim (after the trim/case-fold), so "my-lora" and "my_lora" are different things. Use the copy-names button rather than hand-typing labels and you'll save yourself a debugging session.
Inputs (28)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Base diffusion model the LoRA will be applied to. | |
| clip | CLIP | Base CLIP model the LoRA will be applied to. | |
| enum_value | STRING | String to match against each compare_text_N. | |
| case_sensitiveopt | BOOLEAN | false | If True, 'A' != 'a'. |
| strip_whitespaceopt | BOOLEAN | true | Trim whitespace before comparing. |
| compare_text_1opt | STRING | Case 1 label. Blank = skip this case. | |
| model_1opt | COMBO | Model loaded when compare_text_1 matches enum_value. Blank = unused. | |
| compare_text_2opt | STRING | Case 2 label. Blank = skip this case. | |
| model_2opt | COMBO | Model loaded when compare_text_2 matches enum_value. Blank = unused. | |
| compare_text_3opt | STRING | Case 3 label. Blank = skip this case. | |
| model_3opt | COMBO | Model loaded when compare_text_3 matches enum_value. Blank = unused. | |
| compare_text_4opt | STRING | Case 4 label. Blank = skip this case. | |
| model_4opt | COMBO | Model loaded when compare_text_4 matches enum_value. Blank = unused. | |
| compare_text_5opt | STRING | Case 5 label. Blank = skip this case. | |
| model_5opt | COMBO | Model loaded when compare_text_5 matches enum_value. Blank = unused. | |
| compare_text_6opt | STRING | Case 6 label. Blank = skip this case. | |
| model_6opt | COMBO | Model loaded when compare_text_6 matches enum_value. Blank = unused. | |
| compare_text_7opt | STRING | Case 7 label. Blank = skip this case. | |
| model_7opt | COMBO | Model loaded when compare_text_7 matches enum_value. Blank = unused. | |
| compare_text_8opt | STRING | Case 8 label. Blank = skip this case. | |
| model_8opt | COMBO | Model loaded when compare_text_8 matches enum_value. Blank = unused. | |
| compare_text_9opt | STRING | Case 9 label. Blank = skip this case. | |
| model_9opt | COMBO | Model loaded when compare_text_9 matches enum_value. Blank = unused. | |
| compare_text_10opt | STRING | Case 10 label. Blank = skip this case. | |
| model_10opt | COMBO | Model loaded when compare_text_10 matches enum_value. Blank = unused. | |
| strength_modelopt | FLOAT | 1.00-100–100 | How strongly to modify the diffusion model. Negative values are allowed. |
| strength_clipopt | FLOAT | 1.00-100–100 | How strongly to modify the CLIP model. Negative values are allowed. |
| allow_noneopt | BOOLEAN | false | If enabled, an enum_value of 'none' (the first item in the copied compare-text array) skips loading: the LoRA loader passes (model, clip) through unchanged; the other loaders output nothing for that run. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CLIP | CLIP | — |
| lora_name | STRING | — |
| matched_index | INT | — |
| status | STRING | — |