Nodes/ComfyUI-StableLayers/Load PEFT/diffusers LoRA (Model only)
ComfyUI Node

Load PEFT/diffusers LoRA (Model only)

Load PEFT/diffusers LoRA (Model only) — for when your LoRA is silently doing nothing

By tggo·Created about a month ago·Updated about a month ago· 3
Load PEFT/diffusers LoRA (Model only)
  • model
  • MODEL
lora_name
strength_model1.00
lora_alpha0

The scariest failure in ComfyUI is a normal-looking run that does nothing. That's exactly what happens if you point the stock LoraLoaderModelOnly at a diffusers/PEFT adapter like Stability's Stable-Layers: it loads, it renders, and zero of the LoRA's 840 tensors get applied. No error, no warning you'd notice - just a picture that looks like the adapter was never there.

This node exists to fix that, and it's the engine underneath the whole pack.

The two bugs it fixes

PEFT (the HuggingFace training format) saves LoRA tensors with a base_model.model. prefix - so a Qwen-Image weight is stored as base_model.model.transformer_blocks.0.attn.to_q.lora_A.weight. ComfyUI's QwenImage key map only accepts the bare form, the transformer. prefix, or the SimpleTuner lycoris form. The base_model.model. prefix matches nothing, so every tensor silently misses.

Second trap: PEFT keeps the scale factor (lora_alpha) in a separate adapter_config.json, while ComfyUI reads it from a companion <key>.alpha tensor and otherwise assumes alpha = rank. For Stable-Layers that's r=32, lora_alpha=64 - so even with the keys fixed, the naive loader would apply scale 1.0 instead of the intended 2.0. Half your adapter, invisibly.

PeftLoraLoaderModelOnly strips the base_model.model. prefix, looks for an adapter_config.json next to the weights, reads lora_alpha and r from it, and injects proper .alpha tensors so ComfyUI computes alpha / r the way PEFT does at runtime.

Inputs and outputs

  • model - the MODEL to patch, typically the Qwen-Image-Layered UNet from UNETLoader.
  • lora_name - picks from your models/loras/ folder; the auto-downloaded Stable-Layers adapter is surfaced first when present.
  • strength_model - default 1.0, range −20 to 20. This is the real knob: 1.0 is Stability's own scale, 0.75 keeps a single subject in one layer instead of splitting it into torso/legs/arms.
  • lora_alpha (optional) - leave at 0 and it reads the alpha from adapter_config.json, falling back to rank (scale 1.0) when there's no config. Only set this if you know the adapter's real alpha and it has no config file.

It outputs a single MODEL, wired exactly like any other LoRA loader output - into ModelSamplingAuraFlow, then the sampler.

What to point it at

Any diffusers/PEFT adapter, not just Stable-Layers. Drop the folder into models/loras/, keeping adapter_model.safetensors next to its adapter_config.json, and the node handles it. State dicts that are already in ComfyUI/diffusers form pass through untouched apart from the alpha injection, so it's safe as a general-purpose loader too.

Installing

Install the pack once (ComfyUI Manager → search ComfyUI-StableLayers, or git clone https://github.com/tggo/ComfyUI-StableLayers into custom_nodes), then restart. If you're only using this node you don't even need the base model files - it's pure loader logic.

Verify it actually loaded

A silent no-op is the failure mode this node exists to kill, so check the console: a correct load prints 420 patches attached (60 blocks × 7 modules) and no lora key not loaded lines. See either missing and you're back to square one.

CategoryStable Layers

Inputs (4)

NameTypeDefaultDescription
modelMODEL
lora_nameCOMBO0 options:
strength_modelFLOAT1.00-20–20
lora_alphaoptFLOAT00–2560 = read lora_alpha from the sibling adapter_config.json (falls back to rank, i.e. scale 1.0, when absent).

Outputs (1)

NameTypeDescription
MODELMODEL