Nodes/Santodan Random LoRA Node/Random LoRA Folder Selector
ComfyUI Node

Random LoRA Folder Selector

Roll from a folder, not a curated list

By Santodan·Created about a year ago·Updated 2 months ago· 28
Random LoRA Folder Selector
  • lora_stack
  • exclude_loras_from_node
  • lora_stack
  • trigger_words
  • help_text
exclusive_mode
refresh_lorasfalse
force_refresh_cachefalse
extra_trigger_words
folder_path_1
lora_count_11
min_strength_10.60
max_strength_11.00
folder_path_2
lora_count_21
min_strength_20.60
max_strength_21.00
folder_path_3
lora_count_31
min_strength_30.60
max_strength_31.00
folder_path_4
lora_count_41
min_strength_40.60
max_strength_41.00
folder_path_5
lora_count_51
min_strength_50.60
max_strength_51.00
folder_path_6
lora_count_61
min_strength_60.60
max_strength_61.00
folder_path_7
lora_count_71
min_strength_70.60
max_strength_71.00
folder_path_8
lora_count_81
min_strength_80.60
max_strength_81.00
folder_path_9
lora_count_91
min_strength_90.60
max_strength_91.00
folder_path_10
lora_count_101
min_strength_100.60
max_strength_101.00

The Random LoRA Selector node forces you to curate a pool: ten dropdowns, hand-picked, before the randomizer can do its thing. The Random LoRA Folder Selector removes that chore. Point it at a folder in your models/loras directory and it picks random LoRAs from inside it - the whole "I just want to explore my library" workflow without maintaining a shortlist.

It's the node from the author's own +24 announcement thread, and the one he says behaves correctly (unlike its custom-list sibling, which he admitted had a slot-listing bug). It also understands subfolders, which is where it earns its keep if your loras folder is organized by theme or base model.

How it works

You get ten folder_path_N slots, each with its own lora_count and min/max strength range. For each folder slot you set, the node samples lora_count files at random (clamped to however many exist), assigns each a strength drawn uniformly within that slot's range, and collects them all into a lora_stack output.

Two flags sit on top:

  • refresh_loras - re-roll. With it off, the same folder choices reproduce the same picks; flip it on and every run is fresh.
  • force_refresh_cache - clears the in-memory LoRA-info cache and rebuilds it. Use it after you add new LoRAs and want their trigger words picked up.

Trigger words matter here more than on the list node, because you didn't hand-pick these files - you may have zero idea what most of them train on. Each selected LoRA's trained words are pulled via the sha256-to-CivitAI lookup and cached, then emitted on the trigger_words output so you can concatenate them into your prompt. That's the whole point of the node: random picks you'd never remember tell you what they need.

The inputs you'll set

  • folder_path_1folder_path_10 - dropdowns of your lora subfolders (built by walking models/loras). Pick the pools.
  • lora_count_1 … - how many to draw from each folder.
  • min_strength_N / max_strength_N - per-slot strength range.
  • exclusive_mode - On pulls one LoRA total from everything you collected; Off uses all drawn.
  • exclude_loras_from_node - feed this the output of the pack's ExcludedLoras node (or any LORA_LIST) and those files are skipped by basename. This is the killer feature if your folder is 90% LoRAs you never want to win.
  • lora_stack / extra_trigger_words - optional inputs for chaining more selectors or appending words.

Outputs: lora_stack, trigger_words, help_text.

The gotchas

Same stack caveat as its cousin: this outputs a LORA_STACK, so you apply it with CR Apply LoRA Stack from the Comfyroll pack, not a stock LoraLoader. The optional lora_stack input is for chaining, not for applying.

A Stability Matrix gotcha that bit a real user in the author's thread: the dropdown only shows subfolders ComfyUI actually knows about. If your LoRAs live in a shared SM models folder, the picker can show nothing but "None" - the fix is checking that your extra_model_paths.yaml maps a loras folder (plural - SM used lora and it silently broke the scan). The code does honor extra_model_paths.yaml, so the config, not the node, is usually the culprit.

Also expect a first-run stall: uncached LoRAs trigger CivitAI API lookups one by one. That's what the LoRACachePreloader node in this same pack exists to solve.

Install

ComfyUI Manager (search "Santodan"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/Santodan/santodan-custom-nodes-comfyui

Restart. No dependencies, no downloads - it reads whatever is already in your loras folder.

CategorySantodan/LoRA

Inputs (46)

NameTypeDefaultDescription
exclusive_modeCOMBO2 options: Off, On
refresh_lorasBOOLEANfalse
force_refresh_cacheBOOLEANfalse
lora_stackoptLORA_STACK
extra_trigger_wordsoptSTRING
exclude_loras_from_nodeoptLORA_LIST
folder_path_1optCOMBO1 options: None
lora_count_1optINT11–99
min_strength_1optFLOAT0.60-10–10
max_strength_1optFLOAT1.00-10–10
folder_path_2optCOMBO1 options: None
lora_count_2optINT11–99
min_strength_2optFLOAT0.60-10–10
max_strength_2optFLOAT1.00-10–10
folder_path_3optCOMBO1 options: None
lora_count_3optINT11–99
min_strength_3optFLOAT0.60-10–10
max_strength_3optFLOAT1.00-10–10
folder_path_4optCOMBO1 options: None
lora_count_4optINT11–99
min_strength_4optFLOAT0.60-10–10
max_strength_4optFLOAT1.00-10–10
folder_path_5optCOMBO1 options: None
lora_count_5optINT11–99
min_strength_5optFLOAT0.60-10–10
max_strength_5optFLOAT1.00-10–10
folder_path_6optCOMBO1 options: None
lora_count_6optINT11–99
min_strength_6optFLOAT0.60-10–10
max_strength_6optFLOAT1.00-10–10
folder_path_7optCOMBO1 options: None
lora_count_7optINT11–99
min_strength_7optFLOAT0.60-10–10
max_strength_7optFLOAT1.00-10–10
folder_path_8optCOMBO1 options: None
lora_count_8optINT11–99
min_strength_8optFLOAT0.60-10–10
max_strength_8optFLOAT1.00-10–10
folder_path_9optCOMBO1 options: None
lora_count_9optINT11–99
min_strength_9optFLOAT0.60-10–10
max_strength_9optFLOAT1.00-10–10
folder_path_10optCOMBO1 options: None
lora_count_10optINT11–99
min_strength_10optFLOAT0.60-10–10
max_strength_10optFLOAT1.00-10–10

Outputs (3)

NameTypeDescription
lora_stackLORA_STACK
trigger_wordsSTRING
help_textSTRING