Random LoRA Loader
Roll the dice on style, character, and concept every run
- model
- clip
- MODEL
- CLIP
- positive_text
- negative_text
- positive
- negative
- preview
Random LoRA Loader is the node for the "I want to be surprised, but I don't want to babysit the prompt" workflow. You point it at up to three folders - say one for styles, one for characters, one for concepts - and every time you queue it grabs a random LoRA from each, applies them to your MODEL and CLIP, and also drops the trigger words into the prompt for you. Queue five times, get five genuinely different combinations.
That last part is the whole trick. Anyone who's tried to randomize LoRAs before hits the same wall: a random LoRA is useless unless its trigger words ride along, and hand-maintaining a text file of every LoRA's tags gets old fast. The community keeps asking for exactly this (a recurring r/comfyui request, and the standard workaround is a hand-curated wildcard file). This node does the curation for you by reading trigger words out of the metadata files that already ship with your LoRAs.
How it works
Each of the three groups has a folder path and a count. On execution the node lists .safetensors files in that folder (subfolders included by default), picks num_loras at random without repeating, then reads metadata for each pick: the .metadata.json file ComfyUI Lora Manager writes, then the .info file from Civitai Helper, then metadata embedded in the safetensors itself. From that it pulls trigger words and sample prompts, applies your strengths to MODEL and CLIP, and builds the text and CONDITIONING outputs with the LoRA syntax stripped so you don't get stray <lora:...> tokens turned into garbage words by the CLIP tokenizer.
One big compatibility asterisk, stated right on the repo: SD1.5 and SDXL only. Not Flux, not SD3, not Pony. If you live on modern architectures this isn't your node - it was built around the SD1.5/SDXL U-Net, where the LoRA ecosystem is still enormous and cheap to experiment with.
The inputs that actually matter
You don't touch most of these on day one. The ones you will:
lora_folder_path_1/2/3- absolute paths to your style, character, and concept folders.num_loras_1/2/3- how many to pull from each (0 = skip that group).model_strength_X/clip_strength_X- fixed values like1.0, or random ranges like"0.6-0.9"(picks from 0.6, 0.7, 0.8, 0.9 in 0.1 steps). Negatives work too:"-0.8--0.3"is a real negative LoRA range. MODEL strength controls the visual weight; CLIP strength controls how hard the trigger words push the prompt.seed- standard ComfyUI seed control, so a fixed seed gives you a reproducible pick.trigger_word_source-json_combined(default, merges all tag sources),json_random,json_sample_prompt, ormetadata(embedded only).
The outputs are MODEL and CLIP (straight into your KSampler), positive and negative CONDITIONING (into Set Conditioning or the sampler), positive_text / negative_text (wire to a Show Text node to see what got selected - worth doing while you learn), and preview (an IMAGE batch of the chosen LoRAs' thumbnails). It also plays well with Wildcard Encode from the Inspire Pack: feed its populated_text into additional_prompt_positive and the node strips any LoRA syntax out.
Install
ComfyUI Manager (search "RandomLoRALoader") or:
cd ComfyUI/custom_nodes
git clone https://github.com/shin131002/RandomLoRALoader
Restart ComfyUI. That's it - core dependencies are just the Python standard library plus what ComfyUI already bundles. No model downloads. The only optional add-on is pip install opencv-python, and it only matters if you want video previews to show instead of a black frame; still images, GIFs, and WebP work without it.
Troubleshooting
- Nothing selected. Check the folder path is absolute, that
.safetensorsfiles actually exist there, and thatinclude_subfolders_1is on if your LoRAs live in subfolders. An empty or bogus folder is skipped silently, which is friendly but easy to misread. - No trigger words in the output. The node can only pull what the metadata has. If your LoRAs have no
.metadata.jsonor.infonext to them and no embedded tags, trytrigger_word_source: metadataor just accept the prompt will be tagless. - Weights all going to 1.0. That was a real v1.1.0 bug with negative values; v1.2.0 fixed it. If you're on an old install, update.
- Expect zero support. This is a small, fresh, MIT-licensed pack (v1.2.0, no community footprint) with an explicit no-support policy - if something breaks you fork it. Fair trade for a free randomizer that runs on your own folder.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| clip | CLIP | — | |
| token_normalization | COMBO | none | 4 options: none, mean, length, length+mean |
| weight_interpretation | COMBO | A1111 | 5 options: comfy, A1111, compel, comfy++, down_weight |
| additional_prompt_positive | STRING | — | |
| additional_prompt_negative | STRING | — | |
| lora_folder_path_1 | STRING | — | |
| include_subfolders_1 | BOOLEAN | true | — |
| unique_by_filename_1 | BOOLEAN | true | — |
| model_strength_1 | STRING | 1.0 | — |
| clip_strength_1 | STRING | 1.0 | — |
| num_loras_1 | INT | 10–20 | — |
| lora_folder_path_2 | STRING | — | |
| include_subfolders_2 | BOOLEAN | true | — |
| unique_by_filename_2 | BOOLEAN | true | — |
| model_strength_2 | STRING | 1.0 | — |
| clip_strength_2 | STRING | 1.0 | — |
| num_loras_2 | INT | 00–20 | — |
| lora_folder_path_3 | STRING | — | |
| include_subfolders_3 | BOOLEAN | true | — |
| unique_by_filename_3 | BOOLEAN | true | — |
| model_strength_3 | STRING | 1.0 | — |
| clip_strength_3 | STRING | 1.0 | — |
| num_loras_3 | INT | 00–20 | — |
| trigger_word_source | COMBO | json_combined | 4 options: json_combined, json_random, json_sample_prompt, metadata |
| seed | INT | 00–18446744073709550000 | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CLIP | CLIP | — |
| positive_text | STRING | — |
| negative_text | STRING | — |
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| preview | IMAGE | — |