Nodes/ComfyUI-StableLayers/Stable-Layers LoRA (auto-download)
ComfyUI Node

Stable-Layers LoRA (auto-download)

Stable-Layers LoRA (auto-download) — the one-input node that makes decomposition work

By tggo·Created about a month ago·Updated about a month ago· 3
Stable-Layers LoRA (auto-download)
  • model
  • MODEL
strength_model1.00

This is the node the whole pack exists for. Stability AI shipped a follow-up to Qwen-Image-Layered called Stable-Layers - an adapter fine-tuned with VLM-scored reinforcement learning so the decomposition actually separates a scene into a background plus distinct objects you can move, recolor, delete or animate independently, instead of just slicing things up. But they released it as a bare PEFT checkpoint plus a decompose.py that wants roughly 40 GB of VRAM. On its own, ComfyUI would rather silently ignore it than run it: the stock LoRA loader matches zero of its tensors and applies nothing, and even the keys that did match would apply at half strength.

Stable-Layers LoRA (auto-download) fixes both problems and hides them behind a single node with one real input: strength.

How it works

On first use it fetches the 330 MB adapter from StabilityLabs/Stable-Layers into models/loras/stable-layers/ - that's the "auto-download" part, and it needs an internet connection (and huggingface_hub). Then it does what PeftLoraLoaderModelOnly does under the hood: strips the base_model.model. prefix so ComfyUI's QwenImage key map actually matches all 840 tensors, reads lora_alpha=64 and r=32 from the adapter's config, and injects the alpha tensors so the scale comes out at the intended 2.0 instead of 1.0. A correct load prints 420 patches attached and no lora key not loaded warnings - worth checking once before you trust a run.

Inputs and outputs

  • model - the MODEL from UNETLoader (the Qwen-Image-Layered fp8 or GGUF diffusion model).
  • strength_model - default 1.0, range −20 to 20. This is the knob that actually matters. 1.0 is Stability's own scale, and it chases the "distribute content across layers" reward hard enough to split one figure into torso, legs, arms. That's depth you can drive (per-layer parallax), but if you wanted a single cutout, drop it to 0.75 and the subject comes back whole with a cleaner alpha.

Output is a single MODEL, wired into ModelSamplingAuraFlow and then the KSampler.

Installing it

The pack, once:

cd ComfyUI/custom_nodes
git clone https://github.com/tggo/ComfyUI-StableLayers

plus pip install huggingface_hub for the auto-download (or search ComfyUI-StableLayers in ComfyUI Manager). Then you need the base model - ComfyUI ≥ 0.6.0 supports Qwen-Image-Layered natively. Grab the fp8 diffusion model (20.5 GB, models/diffusion_models/), the layered VAE (254 MB, models/vae/), and the Qwen2.5-VL text encoder (9.4 GB, models/text_encoders/) from the Comfy-Org repos the README links. That combo runs on a 24–32 GB card. Low on VRAM? The GGUF quants from unsloth plus ComfyUI-GGUF work with this loader too; the 40.9 GB bf16 is the full-precision option if you've got the room.

The recipe is not the base model's recipe

This is where people get burned. Stability is explicit that a higher resolution, lower steps, or a non-Heun sampler will garble the results - the adapter's settings are heun, 50 steps, CFG 1.0, 640 px max, 4 layers. That's against the grain of the stock Qwen-Image-Layered template (euler, 20 steps, CFG 2.5). The good news, per the pack's own benchmarks: the adapter itself is nearly free (+2 s); what costs is the 50-Heun-steps recipe. Dropping CFG to 1.0 removes the negative pass and saves ~23%. And prompt the whole image ("a clean, well composed image" beats a detailed essay) - it steers occluded content, not individual layers.

Gotchas

First run downloads the adapter, so expect it to sit there; subsequent runs are instant. If you suspect a silent no-op, look for 420 patches attached in the console. And mind the license if this is for work: the adapter is under the Stability AI Community License - free for research, non-commercial, and commercial use under $1M annual revenue; above that you need an enterprise license. The base Qwen model stays Apache-2.0 if you run without the adapter.

CategoryStable Layers

Inputs (2)

NameTypeDefaultDescription
modelMODEL
strength_modelFLOAT1.00-20–20

Outputs (1)

NameTypeDescription
MODELMODEL