Nodes/Prompt DB/Apply Lora Stack
ComfyUI Node

Apply Lora Stack

Stop retyping your LoRA strengths — this node applies a whole saved stack

By HalfikCode·Created 5 months ago·Updated 5 months ago· 0
Apply Lora Stack
  • model
  • clip
  • lora_stack
  • model
  • clip
lora_config{}

If you've ever rebuilt a character's LoRA stack from memory every time you swap workflows, you know the pain Apply Lora Stack exists to kill. It's the "apply" half of the Prompt DB pack (HalfikCode/ComfyUI-Prompt-DB): instead of a Load LoRA node that takes one filename, it takes a whole LORA_STACK - a list of LoRAs with their strengths - and lays them onto the model and CLIP in one go. The stack usually comes from the pack's own Prompt Selector or Prompt Combiner, which pull LoRAs that are stored inside your saved prompts. Save the prompt once with its LoRAs attached and you never have to remember the filename and the 0.8 again.

It sits right where you'd expect it in the graph: model and clip come in from your checkpoint loader, the lora_stack comes from a selector/combiner, and the outputs feed straight into your sampler's model input and the CLIP Text Encode.

How it actually works

The mechanism is unglamorous but solid. For every entry in the stack (name + strength), it looks the file up in ComfyUI's loras folder, loads it with load_torch_file, and applies it via comfy.sd.load_lora_for_models - same strength for both the model and the CLIP, like the core LoraLoader does. A few details worth knowing:

  • Per-LoRA overrides live in a hidden JSON widget. The lora_config input exists in the node's signature (a STRING defaulting to "{}") but the frontend JS hides it. Clicking the ● circle next to a LoRA or nudging the ◀ ▶ strength arrows writes into that JSON - {name: {enabled: false, strength: 1.2}} - so each run uses your inline tweaks instead of the prompt's defaults. "Reset values" wipes it back to the saved strengths.
  • Missing files are skipped, not fatal. If a LoRA in the stack isn't in your loras folder, it logs [PromptDB] LoRA file not found to the console and moves on. Your workflow keeps running; you just lose that LoRA's effect silently, so keep an eye on the console.
  • Empty stack = pass-through. If lora_stack is null or empty, the node just returns model and clip untouched. Handy as a default when a prompt has no LoRAs attached.
  • Negative strengths work. The web UI allows -2.0 to 2.0, which is useful for the rare "this LoRA is making it worse, subtract it" play.

The inputs and outputs that matter

  • model (MODEL) - your base model.
  • clip (CLIP) - its CLIP model.
  • lora_stack (LORA_STACK) - the list of LoRAs. The one you'll actually wire up.
  • lora_config (STRING) - hidden; you don't touch it directly.

Outputs: model and clip, both with the LoRAs baked in.

Installing

Same story for the whole pack - ComfyUI Manager, search "Prompt Database", install, restart. Or manually:

cd ComfyUI/custom_nodes/
git clone https://github.com/HalfikCode/ComfyUI-Prompt-DB.git

Then restart ComfyUI. There's no requirements.txt - the pack only depends on ComfyUI's own comfy.sd and folder_paths, so no extra pip packages and no model downloads. That's refreshingly rare in this ecosystem, where "install a node" often means "chase a dependency conflict."

Where people get burned

The LORA_STACK type is custom, and the node's inline toggle UI only knows how to trace a stack back to this pack's own Prompt Selector and Prompt Combiner nodes. Wire a lora_stack from some other pack's node and the per-LoRA circles and strength arrows may not populate - the LoRAs can still apply if the data shape matches, but you lose the inline controls. In practice, just keep Apply Lora Stack fed from the pack's own selectors and you're fine. Also remember there's no separate clip-strength knob: unlike some loaders, one strength drives both paths, so a high value can oversaturate the conditioning. Start at 0.8 and nudge.

CategoryPrompt Database

Inputs (4)

NameTypeDefaultDescription
modelMODEL
clipCLIP
lora_configSTRING{}
lora_stackoptLORA_STACK

Outputs (2)

NameTypeDescription
modelMODEL
clipCLIP