Nodes/ComfyUI Seed Wildcard Pack/Seed Based Wildcard (Lora Stack Output)
ComfyUI Node

Seed Based Wildcard (Lora Stack Output)

Wildcards that also pick your LoRAs — per seed

By sinanzoo2nd·Created 8 months ago·Updated 3 months ago· 0
Seed Based Wildcard (Lora Stack Output)
  • model
  • clip
  • lora_stack
  • populated_text
  • model
  • clip
wildcard_file
seed1

LoRA selection is usually a manual decision - you swap the file in, generate, swap it out. SeedBasedWildcardLora ("Seed Based Wildcard (Lora Stack Output)") is the version that lets your wildcard file choose the LoRA for you, deterministically, from the seed. One line in a text file says <lora:my_style:0.8>, the seed decides which line runs, and the node hands back a ready-to-apply LORA_STACK plus the cleaned prompt text. It's the sibling of SeedBasedWildcardImpact, with the LoRA machinery bolted on.

What it does

Four inputs, four outputs. Inputs:

  • model and clip - the current MODEL and CLIP objects, passed through and returned unchanged
  • wildcard_file - a dropdown of .txt files from Impact Pack's wildcards folder
  • seed - the 1-based seed that picks the line

Outputs:

  • lora_stack - a LORA_STACK, the format Impact Pack and similar packs use for stacking LoRAs
  • populated_text - the selected line with all wildcard syntax resolved and every <lora:...> tag removed, ready to go into your prompt
  • model / clip - the exact same objects you fed in

How it works

The line selection is identical to the Impact version: (seed - 1) % line_count picks the line, a random.Random(seed) resolves __tag__ and {a|b|c} and weighted {1::a|9::b} syntax inside it. Then comes the LoRA step.

It scans the resolved text for <lora:name:strength> tags. For each one it splits name, model_strength, and (optionally) a separate clip_strength, then does the genuinely thoughtful bit: it matches your written name against ComfyUI's actual list of installed LoRA files, normalizing backslashes to forward slashes and ignoring extensions. So <lora:my_style:0.8> finds my_style.safetensors even if you wrote the name without the extension or with a path separator that doesn't match. If a strict match fails it falls back to your raw name with a console warning - it degrades gracefully instead of silently dropping the LoRA.

The lora_stack output is a list of (name, model_strength, clip_strength) tuples in that exact Impact Pack format. The <lora:...> tags are stripped out of the text, leaving populated_text clean for your prompt.

The part people misunderstand

The node returns model and clip unchanged - it does not apply the LoRAs itself. LORA_STACK is data; something has to consume it. You wire the stack into a LoraLoader-style node (Impact Pack's, or Efficiency Nodes', or any stack-aware loader) that takes model, clip, and lora_stack and produces the actual modified model and clip. The pack's own outputs are just the transport. If you wire model straight into a KSampler expecting the LoRA to be active, it won't be - and nothing will tell you, so that's the number one confusion with this node.

Why seed-deterministic LoRAs are worth it

Same seed, same LoRA, same text. That turns LoRA selection into a reproducible axis of your seed variation: roll a seed, get a style, iterate, and when you find the combination you like, the seed alone reproduces it. It also lets you keep LoRA choices in your wildcard files - text you can version-control and reason about - instead of buried in node settings.

Install and gotchas

Same pack, same dance:

cd ComfyUI/custom_nodes
git clone https://github.com/sinanzoo2nd/ComfyUI-Seed-Wildcard-Pack

or ComfyUI Manager → Seed Wildcard. No requirements.txt, no model downloads.

The gotchas, in order of how often they bite:

  1. Impact Pack must be installed. The wildcard folder is hard-coded to custom_nodes/ComfyUI-Impact-Pack/wildcards. No Impact Pack → the dropdown shows the placeholder no_txt_files_found.txt and the node outputs an empty stack.
  2. Apply the stack yourself. model/clip outputs are passthroughs; feed the stack into a stack-aware LoraLoader.
  3. Strict matching means exact names. The fuzzy matching fixes separators and extensions, but my_style vs my_style_v2 is not a match - name your tags to match your files.
  4. Seed minimum is 1 (unlike the Impact node's negative-tolerant range). Seed 0 isn't accepted by the UI, so no surprise last-line index - but also no negative-seed guard, which is consistent with the pack's own Seed Generator node being the recommended front end.

If you're already using wildcard files for prompts, adding <lora:...> lines to them is a one-line change that unlocks a whole axis of variation you didn't have. Just don't forget the loader.

CategoryCustom/Wildcard

Inputs (4)

NameTypeDefaultDescription
modelMODEL
clipCLIP
wildcard_fileCOMBO1 options: no_txt_files_found.txt
seedINT11–18446744073709550000

Outputs (4)

NameTypeDescription
lora_stackLORA_STACK
populated_textSTRING
modelMODEL
clipCLIP