LoRA Randomize Strength on Text
Randomize LoRA strength inside the prompt string
- modified_text
Most people tune a LoRA's strength by dragging a slider on the loader. LoRA Randomize Strength on Text takes a different route: it works on the prompt text - on <lora:name:strength> tags - and rewrites the strengths for you, randomly, within a sane budget. Drop in a prompt, get back a prompt where every LoRA strength has been rolled anew, seeded so you can reproduce the roll. It's variation exploration done at the string level, which is the whole philosophy of this pack.
The trick is that many ComfyUI LoRA loaders accept their LoRA spec as a string - and the pack itself ships Wan LoRA-by-text loaders that parse exactly these tags. So you can build a loop: randomize strengths in the text → feed the text to the loader → generate → repeat, and every pass explores a different LoRA balance without you touching a widget. That's a genuinely useful pattern for finding the strength mix that works for a scene.
How it works
It parses <lora:name:strength> tags (the standard syntax), and does one of three things depending on its mode:
randomize(off by default) - rolls new strengths for every LoRA. The roll is budgeted, not unlimited: it uses an internal total-strength budget and a per-LoRA maximum (roughly a 1.5 total cap and 0.9 individual cap in the shipped code), so you don't get a prompt where six LoRAs are all at 1.5 simultaneously. That budget is why randomize results stay usable instead of turning into mush.highlight- the inverse: it dims all LoRAs to near-zero and spikes one (highlighting) to full strength. Handy for "let me see what this one LoRA actually does" - an isolation test without removing the other tags.- Neither - pure pass-through; the text comes back unchanged.
When both randomize and highlight are on, randomize wins - the code says so explicitly. seed controls the roll; set it to reproduce an exact set of strengths. Surrounding prompt text is preserved untouched; only the tags are rewritten. Optional debug_prints shows the parse and the roll.
Output is a single modified_text string - wire it into your text-based LoRA loader, or combine it with other prompt text downstream. It does not apply the LoRA itself; something downstream has to consume the tags.
Installing it
Part of CorvaeOboro's ComfyUI_illumorae (CC0, pure code). ComfyUI Manager → search illumorae, or:
cd ComfyUI/custom_nodes
git clone https://github.com/CorvaeOboro/ComfyUI_illumorae
Common issues
- Output is identical to input - both modes are off by default; flip
randomizeorhighlighton. Or your text has no LoRA tags at all, in which case there's nothing to rewrite. - Randomize gives a LoRA 0.00 - that's intentional (the budget ran out); the tag stays present but disabled rather than being deleted.
- "Where's the slider?" - there isn't one, by design. If you want deterministic control over every LoRA at once, the pack's LoRA Strength Multiplier on Text (multiply everything, clamp individually or by total) is the complementary node.
- Nothing downstream changes - remember this node only rewrites a string. If your workflow loads LoRAs via dropdowns, the modified text does nothing; it needs a loader that reads LoRA tags from text.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| randomize | BOOLEAN | false | — |
| highlight | BOOLEAN | false | — |
| seed | INT | 0 | — |
| debug_printsopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| modified_text | STRING | — |