Nodes/ComfyUI-cluster/Dynamic LoRA Stack
ComfyUI Node

Dynamic LoRA Stack

The glue that makes a planner's LoRA picks actually load

By GeekatplayStudio·Created 7 months ago·Updated 7 months ago· 24
Dynamic LoRA Stack
  • model
  • clip
  • MODEL
  • CLIP
  • debug_info
loras
lora_strengths
custom_path

Dynamic LoRA Stack is the workhorse that turns the ComfyUI-cluster planners' text output into actual LoRAs on your model. The Ollama planners hand you LoRA names as a plain comma-separated string; stock ComfyUI's LoraLoader wants one LoRA per node. This node bridges the gap: feed it the comma-separated list plus a comma-separated list of strengths, and it stacks them all onto your model and clip in one pass, one after another.

If you've only ever used the pack's planners, this is where the "planner picked three LoRAs" promise gets kept. It's the DynamicLoraStack in the flow that sits right after DynamicCheckpointLoader and before CLIPTextEncode, exactly as the pack's four workflows wire it.

How it works

You give it a model and a clip, plus two plain strings:

  • loras - comma-separated LoRA filenames, e.g. Boreal_Realism_Flux.safetensors, Detail_Tweaker.safetensors
  • lora_strengths - comma-separated floats, one per LoRA, e.g. 0.8,0.5

It splits both strings on commas, pairs them up, and applies each LoRA with load_lora_for_models, stacking the result onto the same model/clip pair. Missing strengths default to 0.7 rather than crashing. custom_path lets you point it at an external LoRA folder if your models live somewhere ComfyUI doesn't know about.

The interesting bit is the fallback. If a named LoRA isn't on disk, the node looks it up in the pack's model_registry.json, finds its group and category, and tries to load a sibling LoRA from the same group/category that is installed. No match means it logs "Skipping missing LoRA" and moves on - a missing LoRA never kills the whole chain.

The outputs that matter

It returns the updated MODEL and CLIP (wire these into your sampler/encoders) plus a debug_info string that logs every lookup, strength, and skip. If a LoRA silently didn't apply, that string tells you why. Given how much invisible failover this node does, checking debug_info is not optional once things look off.

How to install it

Part of the GeekatplayStudio/ComfyUI-cluster pack. Install with ComfyUI Manager (search "ComfyUI-cluster") or:

cd ComfyUI/custom_nodes
git clone https://github.com/GeekatplayStudio/ComfyUI-cluster

Then restart ComfyUI. No extra Python packages - the node uses ComfyUI's built-in LoRA loading. The only external piece is Ollama, and this node doesn't even call it; the registry it reads for fallbacks is the local JSON file in the pack folder.

Troubleshooting

Three things bite people. First, mismatched lists: if your strengths string has fewer entries than your LoRA list, the extras silently ride at 0.7 - decide if that's what you want. Second, wrong model folder: the node only searches ComfyUI's loras folder plus your custom_path, so a LoRA sitting in the wrong directory won't be found and will get skipped. Third, the fallback itself can surprise you - if Detail_Tweaker.safetensors is missing and the node quietly substitutes a different LoRA from the same category, your output will look different and you'll have no idea unless you read debug_info. The pack's manage_models.bat (via sync_registry.py --sync) is the tool for keeping the registry honest about what's actually on disk, which prevents a lot of this.

CategoryOllama/Loader

Inputs (5)

NameTypeDefaultDescription
modelMODEL
clipCLIP
lorasSTRING
lora_strengthsSTRING
custom_pathSTRING

Outputs (3)

NameTypeDescription
MODELMODEL
CLIPCLIP
debug_infoSTRING