Nodes/unwdef-nodes/Randomize LoRAs
ComfyUI Node

Randomize LoRAs

Let chance pick your LoRAs — and their weights — for you

By unwdef·Created 2 years ago·Updated about a year ago· 6
Randomize LoRAs
  • model
  • clip
  • model
  • clip
  • trigger_words
  • chosen_loras
seed0
min_random1
max_random10
lora_1
min_str_10.50
max_str_11.00
trigger_words_1
lora_2
min_str_20.50
max_str_21.00
trigger_words_2
lora_3
min_str_30.50
max_str_31.00
trigger_words_3
lora_4
min_str_40.50
max_str_41.00
trigger_words_4
lora_5
min_str_50.50
max_str_51.00
trigger_words_5
lora_6
min_str_60.50
max_str_61.00
trigger_words_6
lora_7
min_str_70.50
max_str_71.00
trigger_words_7
lora_8
min_str_80.50
max_str_81.00
trigger_words_8
lora_9
min_str_90.50
max_str_91.00
trigger_words_9
lora_10
min_str_100.50
max_str_101.00
trigger_words_10

Normally a LoRA is a deliberate choice: you load one, type a trigger word, decide a strength, hit generate. Randomize LoRAs is the opposite - you hand it a pool of up to ten LoRA files and let a seeded dice roll decide which ones get applied and at what strength. It's LoRA roulette, and for exploration it's surprisingly good at surfacing combinations you'd never have stacked by hand.

Why LoRA roulette

Why would you want random? Because stacking LoRAs is genuinely unpredictable. Each one is a small patch to the model's attention layers, and they interact in ways nobody fully predicts - the knowledge base's own write-up on the subject is blunt about it: "interactions are unpredictable." So instead of agonizing over which three of your forty LoRAs go together, you let the node sample a subset and farm the results. When a roll lands, save the seed. That's the whole loop.

How it works

Here's the mechanism. You connect the model and clip outputs of your checkpoint loader into the node. Each of the ten slots has a LoRA dropdown (auto-populated from your models/loras folder), a min and max strength, and an optional trigger-words field. The node picks a random count between min_random and max_random, samples that many LoRAs (no repeats - and it dedupes the same file picked in two slots, a fix that landed in version 1.1.0), then rolls each one's strength uniformly between its min and max. It applies everything by calling ComfyUI's own LoraLoader under the hood, which is why this pack carries no dependency bloat.

The inputs you'll actually touch

The inputs you'll actually touch:

  • seed - the reproducibility key. Same seed plus the same ten slots filled equals the same roll. The README's one caveat: keep the same selected LoRAs for that to hold.
  • min_random / max_random - how many LoRAs get applied, from 1 to 10. Set both to 2 and you get exactly two every time; set them to 1 and 5 and the count itself becomes random.
  • lora_x + min_str_x + max_str_x - the pool. Each slot's strength range defaults to 0.5–1.0.

The outputs everyone misses

Then there are the two outputs people miss. trigger_words gives you the deduped, sorted trigger words of whatever got picked - paste that into your prompt so the LoRAs actually do anything (the classic "my LoRA does nothing" failure is a missing trigger word). chosen_loras hands you the exact <lora:name:strength> strings for the roll, which is gold for pasting into metadata or a Show Text node so you can record what worked. And of course model and clip wire straight into your KSampler.

Before you trust it

Three things to know before you trust it. First, the strength range goes to -10 and 10 - negative strengths invert a LoRA's effect, and you do not want a random roll of -8. Set min_str to 0 or above. Second, the same-seed correlation again: two RandomizeLoras nodes sharing a seed roll the same subset. Third, if you leave every slot on "None" the node passes model and clip through untouched - useful as a bypass, but easy to mistake for a broken workflow.

Installing

Install via ComfyUI Manager (search "unwdef") or:

cd ComfyUI/custom_nodes
git clone https://github.com/unwdef/unwdef-nodes-comfyui.git

Restart ComfyUI. No pip install, no model downloads - the whole pack is plain Python on ComfyUI core. Updates are a git pull in that folder and a restart.

Categoryunwdef/lora

Inputs (45)

NameTypeDefaultDescription
modelMODEL
clipCLIP
seedINT00–18446744073709550000
min_randomINT11–10
max_randomINT101–10
lora_1COMBO1 options: None
min_str_1FLOAT0.50-10–10
max_str_1FLOAT1.00-10–10
trigger_words_1STRING
lora_2COMBO1 options: None
min_str_2FLOAT0.50-10–10
max_str_2FLOAT1.00-10–10
trigger_words_2STRING
lora_3COMBO1 options: None
min_str_3FLOAT0.50-10–10
max_str_3FLOAT1.00-10–10
trigger_words_3STRING
lora_4COMBO1 options: None
min_str_4FLOAT0.50-10–10
max_str_4FLOAT1.00-10–10
trigger_words_4STRING
lora_5COMBO1 options: None
min_str_5FLOAT0.50-10–10
max_str_5FLOAT1.00-10–10
trigger_words_5STRING
lora_6COMBO1 options: None
min_str_6FLOAT0.50-10–10
max_str_6FLOAT1.00-10–10
trigger_words_6STRING
lora_7COMBO1 options: None
min_str_7FLOAT0.50-10–10
max_str_7FLOAT1.00-10–10
trigger_words_7STRING
lora_8COMBO1 options: None
min_str_8FLOAT0.50-10–10
max_str_8FLOAT1.00-10–10
trigger_words_8STRING
lora_9COMBO1 options: None
min_str_9FLOAT0.50-10–10
max_str_9FLOAT1.00-10–10
trigger_words_9STRING
lora_10COMBO1 options: None
min_str_10FLOAT0.50-10–10
max_str_10FLOAT1.00-10–10
trigger_words_10STRING

Outputs (4)

NameTypeDescription
modelMODEL
clipCLIP
trigger_wordsSTRING
chosen_lorasSTRING