huggingface / huggingface/diffusers
PixArtSigmaPipeline: no LoRA loading support
- Dominant language
- Python
- Stars
- 34.5k
- Forks
- 7.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 91
Description
### Describe the bug
~~Calling `pipe.load_lora_weights(...)` on `ErnieImagePipeline` raises `AttributeError: 'ErnieImagePipeline' object has no attribute 'load_lora_weights'`. Neither the pipeline nor its denoiser, `ErnieImageTransformer2DModel`, currently has LoRA support wired up:~~
- ~~`ErnieImagePipeline` doesn't inherit a `*LoraLoaderMixin` (checked the registry in `diffusers/loaders/lora_pipeline.py` — there's no `ErnieLoraLoaderMixin`, unlike the ~20 other architectures that have one: SD, SDXL, SD3, Flux, Sana, Lumina2, QwenImage, ZImage, HiDream, etc.).~~
- ~~`ErnieImageTransformer2DModel` doesn't inherit `PeftAdapterMixin`, so there's no `transformer.add_adapter()` route either.~~
**Side note, same gap, another model:** `PixArtSigmaPipeline` is in the same spot — no `*LoraLoaderMixin`, and `PixArtTransformer2DModel` has no `PeftAdapterMixin` either. But that one's been around since early 2024 (#7654) without LoRA support landing since.
### Reproduction
```python
import torch
from diffusers import DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained("", torch_dtype=torch.bfloat16)
pipe.load_lora_weights("path/to/lora.safetensors")
```
```
AttributeError: 'ErnieImagePipeline' object has no attribute 'load_lora_weights'
```
The same call on `PixArtSigmaPipeline.from_pretrained("PixArt-alpha/PixArt-Sigma-XL-2-1024-MS")` hits the identical `AttributeError`.
### Logs
```
AttributeError: 'ErnieImagePipeline' object has no attribute 'load_lora_weights'
```
### System Info
- diffusers commit: 0f1abc4ae8b0eb2a3b40e82a310507281144c423 (main)
- Python: 3.12
- Platform: Linux
### Who can help?
@yiyixuxu @sayakpaul
Contributor guide
Research direction
Start with diffusers/loaders/lora_pipeline.py, then inspect ErnieImagePipeline, PixArtSigmaPipeline, ErnieImageTransformer2DModel, and PixArtTransformer2DModel. Run the reported load_lora_weights reproductions first. Done means the affected pipelines and denoisers support the requested LoRA loading path without the reported AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 43/100