Nodes/LoRA Power-Merger ComfyUI/PM LoRA Stacker (from Directory)
ComfyUI Node

PM LoRA Stacker (from Directory)

Load every LoRA in a folder into one stack, strengths included

By larsupb·Created 2 years ago·Updated 29 days ago· 75
PM LoRA Stacker (from Directory)
  • model
  • clip
  • LoRAStack
  • LoRAWeights
directory
strength_model1.00
strength_clip1.00
layer_filterfull
sort_byname
limit-1

Hand-loading LoRAs one at a time is fine when you have three. It's a chore when you have forty style LoRAs in a folder and you want to batch-merge them or compare them all. This node is the "point it at a directory and walk away" version: give it a folder path and it loads every LoRA in there into a stack, with a single strength applied to all of them. Combine it with the Stack Sampler and you've got a one-shot A/B test of your entire collection.

It's the node to reach for when your merge experiment needs the whole collection as inputs - like finding which combination of styles in a folder gives the merge you want. The unified strength is the catch: one strength_model and one strength_clip for everything. If you need per-LoRA strengths, that's PM LoRA Power Stacker's job instead.

How it works

It needs a model and clip connection because it uses them to resolve key mappings - how LoRA keys map onto the model and text encoder. It then scans directory, sorts the files (by name or date, either direction), applies layer_filter, and builds the stack. The optional limit (default -1 = all) caps how many it loads, which is handy when a folder has 200 files and you only want the first 20.

The inputs that matter

  • model and clip - wire in your checkpoint's model and CLIP. Required.
  • directory - the folder path containing your .safetensors LoRAs.
  • strength_model / strength_clip - global strengths for all LoRAs (default 1.0, range −10 to 10). The stack sampler will show you per-LoRA results even though the strength is uniform.
  • layer_filter - full, attn-only, mlp-only, attn-mlp. If you only want attention layers merged, this is the dial.
  • sort_by and limit - ordering and count control.

Two outputs: LoRAStack (the patches, UNet + CLIP) and LoRAWeights (the strength metadata). Both feed straight into PM LoRA Stack Decompose.

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

The directory path must point at a folder ComfyUI's process can read - relative paths resolve against the ComfyUI working directory, so an absolute path is the reliable choice. Mixed-format folders will bite you: throw a LoHA or DoRA file in and it won't decompose cleanly later; keep the folder to standard LoRA format. And remember the strength is global, so if one LoRA in the folder is way louder than the rest, you'll notice it across the whole batch - check the stack sampler output before you commit to a merge.

CategoryLoRA PowerMerge

Inputs (8)

NameTypeDefaultDescription
modelMODELThe diffusion model used to load LoRA UNet key mappings.
clipCLIPThe CLIP model used to load LoRA CLIP key mappings.
directorySTRING
strength_modelFLOAT1.00-10–10General model strength applied to all LoRAs.
strength_clipFLOAT1.00-10–10General CLIP strength applied to all LoRAs.
layer_filterCOMBOfullFilter for specific layers.
sort_byCOMBOnameSort LoRAs by name or size.
limitINT-1-1–1000Limit the number of LoRAs to load.

Outputs (2)

NameTypeDescription
LoRAStackLoRAStack
LoRAWeightsLoRAWeights