Nodes/DarkPrompts/Dark LoRA Pop LoRA string from LORA_STACK
ComfyUI Node

Dark LoRA Pop LoRA string from LORA_STACK

Pull one LoRA out of a stack at a time — the iterator for LoRA lists

By darkpixel·Created 3 years ago·Updated about a year ago· 11
Dark LoRA Pop LoRA string from LORA_STACK
  • LORA_STACK
  • LORA_STACK
  • EXTRACTED_LORA

DarkPopLoraFromStack is a list-management node wearing a LoRA costume. You hand it a LORA_STACK and it pops the first entry off the front, then gives you back two things: the remaining stack, and the LoRA you popped - as a plain string. Pop, pop, pop your way through the list, and each step leaves the stack smaller. It's the "iterate over my LoRAs" primitive.

When you'd actually use it

Its name says it all: "Pop LoRA string from LORA_STACK." The pattern it enables is the loop. ComfyUI doesn't have a great native notion of iterating a graph, but it does re-run nodes when their inputs change - so a stack that shrinks by one each pass lets you step through a list of LoRAs and do something per-entry: feed each into a text box, a weight slider, a display node, or a condition that branches once the stack is empty. If you've built a stack with DarkLoraStackFromString (or any stack-producing node), this is how you dismantle it one piece at a time.

How it works

One input, LORA_STACK (the standard list-of-tuples type, each tuple being (name, model_weight, clip_weight)). It pops the first tuple, and the EXTRACTED_LORA output carries just the name string - the weight info is discarded. The stack output is whatever's left, so wiring the stack output back into the same node's input is what creates the shrink-as-you-go behavior.

One subtlety worth knowing: the pop mutates the list in place in the node's implementation. That's fine within a single run, but it means you shouldn't assume the incoming stack is untouched if other branches read it too - and if you want the original back, keep the stack-producing node upstream of every consumer.

Inputs: LORA_STACK (required). Outputs: LORA_STACK (the remainder) and EXTRACTED_LORA (STRING, the name).

Who this is for

Honestly? A niche within a niche. If your workflow is plain "load these three LoRAs and generate," you don't need this node - you'd use DarkLoRALoader or DarkLoraStackFromString and be done. This one exists for the people building stateful, conditional workflows: plot-like sweeps, LoRA staging, "apply A, then B, then stop" logic. If you've never felt the need to iterate a LoRA list programmatically, skip it without guilt. If you have, you'll recognize instantly why popping the front and handing back the name matters - the remaining stack becomes your loop counter.

Install

Same pack, same two options:

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

Restart ComfyUI, or install via Manager ("DarkPrompts"). No models, no pip dependencies. The only prerequisite that actually matters is having something upstream that produces a LORA_STACK in the first place.

CategoryDarkPrompt

Inputs (1)

NameTypeDefaultDescription
LORA_STACKLORA_STACK

Outputs (2)

NameTypeDescription
LORA_STACKLORA_STACK
EXTRACTED_LORASTRING