ComfyUI Node

PM LoRA Select

Grab one LoRA out of a stack by index

By larsupb·Created 2 years ago·Updated 30 days ago· 75
PM LoRA Select
  • key_dicts
  • lora_raw_dict
  • LoRABundle
index0

Sometimes you want a stack, and sometimes you want one LoRA out of it. This tiny node does exactly that: pick a LoRA from a LoRAStack by its position and get back a single LoRABundle. It's the glue node you reach for when a downstream node expects one LoRA (like PM Resize LoRA or the sampler nodes) but your workflow is built around stacks.

The index is zero-based, so 0 is the first LoRA in the stack. If your stack came from a Directory Stacker that sorted alphabetically or by date, the index maps to whatever that ordering produced - which is actually a neat trick: sort the directory, then select a specific LoRA by position without ever touching the file list.

The inputs that matter

  • key_dicts - the LoRAStack you're pulling from.
  • index - which LoRA to select (default 0, range 0–1000).
  • lora_raw_dict (optional) - hand it the raw LoRA state dict (the LoRARawDict output that stackers can provide) and the node preserves the CLIP weights for that LoRA. Without it, you get the UNet-side weights only. That's the one input people actually get burned on: skip it and your selected LoRA may lose its text-encoder component.

Output is a single LoRABundle. That's the whole node - if you were hoping for more, it's meant to be boring.

Installing

Part of the LoRA Power-Merger pack. ComfyUI Manager (search "LoRA Power-Merger") or:

cd ComfyUI/custom_nodes
git clone https://github.com/larsupb/LoRA-Merger-ComfyUI
cd LoRA-Merger-ComfyUI
pip install -r requirements.txt

Restart ComfyUI. Dependencies: PyTorch, lxml, mergekit.

Common issues

Index out of range is the obvious one - it's a hard error, so count from zero and check your stack size. The subtler trap is the missing CLIP weights when you skip lora_raw_dict: the selected LoRA works, but any text-encoder effect it had is gone, which shows up as a slightly-off result rather than an error. If you're selecting from a stack built by PM LoRA Power Stacker or the directory stacker, wire the LoRARawDict output through when you want the full LoRA.

CategoryLoRA PowerMerge

Inputs (3)

NameTypeDefaultDescription
key_dictsLoRAStack
indexINT00–1000Index of the LoRA to select.
lora_raw_dictoptLoRARawDictOptional raw LoRA dict to preserve CLIP weights

Outputs (1)

NameTypeDescription
LoRABundleLoRABundle