Nodes/DarkPrompts/Dark LoRA Stack from String
ComfyUI Node

Dark LoRA Stack from String

Turn a tagged prompt into a LoRA stack — without actually applying it, if you like

By darkpixel·Created 3 years ago·Updated about a year ago· 11
Dark LoRA Stack from String
  • model
  • clip
  • MODEL
  • CLIP
  • string_out
  • LORA_STACK
string_in

DarkLoraStackFromString is the parsing half of the LoRA-tag story, and its trick is that applying the LoRAs is optional. Feed it a string full of <lora:...> tags and it extracts them into a LORA_STACK and strips them out of the text. But unless you also wire in a model and clip, it won't load anything - it just hands you the stack. That separation is what makes it useful for two very different jobs.

Job one: build a stack for XY plots

This is the README's stated purpose. A LORA_STACK is the input type that Efficient Nodes-style loaders and XY-plot setups consume, and those tools let you sweep a variable across a grid - swap which LoRA is active per tile, or vary its weight. If your prompt is already written with tags, this node converts it into the stack format without you hand-building a tuple list. Wire in a string, take the LORA_STACK output, and let the plot machinery take over. (Wire in model/clip too and it applies as well as extracts - but for plotting you usually don't want it applied up front, or the plot has nothing left to vary.)

Job two: parse-and-apply in one node

Connect a model and clip, and each tag gets loaded through ComfyUI's standard LoRA machinery before the stack is built. It's a close cousin of DarkLoRALoader in the same pack - the difference is the tag format and the workflow intent. This node's regex wants explicit <lora:name:model_weight:clip_weight> (clip weight optional, defaults to the model weight); DarkLoRALoader is the looser, prefix-matching fork of LoraTagLoader. Both strip tags from the text as they go.

Outputs: MODEL, CLIP, string_out (tags removed), and LORA_STACK.

What to watch

  • It only looks in your first LoRA folder path. The source reads folder_paths.get_folder_paths("loras")[0] - if you've split LoRAs across extra search paths, tags for those may not resolve.
  • Missing files are skipped with a console line, and invalid weights are logged and dropped. Same quiet-failure pattern as DarkLoRALoader.
  • Filenames without .safetensors get it appended automatically, which is handy but means a tag like <lora:char:0.8> resolves to char.safetensors.
  • Without model/clip connected, the MODEL and CLIP outputs pass through as None - fine for stack-building, but wire them in if you're actually generating with the output.

Install

Manager → "DarkPrompts", or:

cd ComfyUI/custom_nodes
git clone https://github.com/darkpixel/darkprompts.git

Restart ComfyUI. No models, no dependencies beyond ComfyUI core. If your prompt-writing habit is already tag-first, this is the node that makes that habit compose with the plotting side of the ecosystem.

CategoryDarkPrompt

Inputs (3)

NameTypeDefaultDescription
string_inSTRING
modeloptMODEL
clipoptCLIP

Outputs (4)

NameTypeDescription
MODELMODEL
CLIPCLIP
string_outSTRING
LORA_STACKLORA_STACK