Nodes/Quality of Life Nodes for ComfyUI/Lora Enum Switch 10X (Soze)
ComfyUI Node

Lora Enum Switch 10X (Soze)

A LoRA Loader That Picks One of Ten by a String — The Batch-Workflow Unclogger

By SozeInc·Created 2 years ago·Updated 8 days ago· 10
Lora Enum Switch 10X (Soze)
  • model
  • clip
  • MODEL
  • CLIP
  • lora_name
  • matched_index
  • status
enum_value
case_sensitivefalse
strip_whitespacetrue
compare_text_1
model_1
compare_text_2
model_2
compare_text_3
model_3
compare_text_4
model_4
compare_text_5
model_5
compare_text_6
model_6
compare_text_7
model_7
compare_text_8
model_8
compare_text_9
model_9
compare_text_10
model_10
strength_model1.00
strength_clip1.00
allow_nonefalse

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.

Categoryloaders

Inputs (28)

NameTypeDefaultDescription
modelMODELBase diffusion model the LoRA will be applied to.
clipCLIPBase CLIP model the LoRA will be applied to.
enum_valueSTRINGString to match against each compare_text_N.
case_sensitiveoptBOOLEANfalseIf True, 'A' != 'a'.
strip_whitespaceoptBOOLEANtrueTrim whitespace before comparing.
compare_text_1optSTRINGCase 1 label. Blank = skip this case.
model_1optCOMBOModel loaded when compare_text_1 matches enum_value. Blank = unused.
compare_text_2optSTRINGCase 2 label. Blank = skip this case.
model_2optCOMBOModel loaded when compare_text_2 matches enum_value. Blank = unused.
compare_text_3optSTRINGCase 3 label. Blank = skip this case.
model_3optCOMBOModel loaded when compare_text_3 matches enum_value. Blank = unused.
compare_text_4optSTRINGCase 4 label. Blank = skip this case.
model_4optCOMBOModel loaded when compare_text_4 matches enum_value. Blank = unused.
compare_text_5optSTRINGCase 5 label. Blank = skip this case.
model_5optCOMBOModel loaded when compare_text_5 matches enum_value. Blank = unused.
compare_text_6optSTRINGCase 6 label. Blank = skip this case.
model_6optCOMBOModel loaded when compare_text_6 matches enum_value. Blank = unused.
compare_text_7optSTRINGCase 7 label. Blank = skip this case.
model_7optCOMBOModel loaded when compare_text_7 matches enum_value. Blank = unused.
compare_text_8optSTRINGCase 8 label. Blank = skip this case.
model_8optCOMBOModel loaded when compare_text_8 matches enum_value. Blank = unused.
compare_text_9optSTRINGCase 9 label. Blank = skip this case.
model_9optCOMBOModel loaded when compare_text_9 matches enum_value. Blank = unused.
compare_text_10optSTRINGCase 10 label. Blank = skip this case.
model_10optCOMBOModel loaded when compare_text_10 matches enum_value. Blank = unused.
strength_modeloptFLOAT1.00-100–100How strongly to modify the diffusion model. Negative values are allowed.
strength_clipoptFLOAT1.00-100–100How strongly to modify the CLIP model. Negative values are allowed.
allow_noneoptBOOLEANfalseIf 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)

NameTypeDescription
MODELMODEL
CLIPCLIP
lora_nameSTRING
matched_indexINT
statusSTRING