Nodes/unwdef-nodes/Randomize LoRAs (Stack)
ComfyUI Node

Randomize LoRAs (Stack)

Randomize LoRAs (Stack) — the same roulette, for Efficiency Nodes users

By unwdef·Created 2 years ago·Updated about a year ago· 6
Randomize LoRAs (Stack)
  • lora_stack
  • LORA_STACK
  • 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

Randomize LoRAs (Stack) is the sibling of the pack's main LoRA node with one crucial difference: instead of patching model and clip directly, it hands you a LORA_STACK - the list of LoRA tuples that nodes with stacking support consume. If you've never touched Efficiency Nodes, this one is aimed at you anyway, and you can safely read "stack" as "a list I hand to another node to apply."

Why the stack version

Why would you want that? Two reasons, both good. First, if your model-loading already runs through Efficiency Nodes' consolidated loaders, a direct-patching random node fights that flow - it loads its own model, applies LoRAs, and hands back a modified model you'd have to splice in somewhere. The stack version just produces data, so it drops cleanly into the chain: randomize here, stack there, load once. Second, it has an optional lora_stack input, so you can feed in the LoRAs you always want and let the node add random ones on top. Fixed base plus random accent, in one wire.

How it works

Mechanically it's the same engine as RandomizeLoras: up to ten slots, each with a LoRA file, a min/max strength range, and optional trigger words; a seeded roll decides how many get picked and at what strength. Each chosen LoRA becomes a (name, strength, strength) tuple appended to the stack - the same strength for model and clip, which is what the stack format expects. The trigger-words and chosen-loras strings are produced exactly like the non-stack version, so you still get a human-readable record of the roll.

Inputs and outputs

The inputs you care about: seed (reproducibility), min_random / max_random (how many LoRAs the roll picks), the ten lora_x / min_str_x / max_str_x slots for your pool, and the optional lora_stack input if you're chaining. Outputs are LORA_STACK - feed it to a Lora Stacker or an Efficiency loader - plus trigger_words and chosen_loras for your prompt and metadata.

Gotchas

The gotchas are the stack-shaped ones. Nothing applies your roll for you: if the LORA_STACK output isn't wired to a consumer node, you've spent the whole roll for nothing. Keep the same seed and same slots for reproducibility. And keep strength minimums above zero - the range allows negatives, and a random negative-strength LoRA is a surprise you don't want.

Honest caveat: this node barely has an audience yet - it's the least-searched of the four in the pack. If you're first to this party, the non-stack Randomize LoRAs is the better-documented sibling, and the stack node is worth reaching for only when you're already building through Efficiency Nodes.

Installing

Install is the same story as the rest of the pack: ComfyUI Manager, search "unwdef", or:

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

Restart, done. No pip step, no models - the whole pack is pure Python on top of ComfyUI core. Updates are a git pull and a restart.

Categoryunwdef/lora

Inputs (44)

NameTypeDefaultDescription
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
lora_stackoptLORA_STACK

Outputs (3)

NameTypeDescription
LORA_STACKLORA_STACK
trigger_wordsSTRING
chosen_lorasSTRING