huggingface / huggingface/diffusers

Error in loading Lora

Aperta
#11,224 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug lora stale
Lingua principale
Python
Stelle
34.5k
Fork
7.3k
Merge medio
3g 3h
PR unite (30g)
91

Descrizione

### Describe the bug

`lora_unet_label_emb_0_0.alpha` not supported error. I have uploaded the model on hugging face. Error appears on `load_lora_weights()` function

### Reproduction

```

from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
pipe.load_lora_weights("artemonlysuno/sdxl-lora-neutral1")

prompt = "abstract portrait of 1girl,undefined gender,fragmented visual style,red and black color palette,evokes feelings of rebellion,passion,and freedom,blurred boundaries,high resolution,aesthetic,"
image = pipe(prompt).images[0]
```

### Logs

```shell
Traceback (most recent call last):
File "/home/user/rw/Oleg/sd-base-api/test_lora.py", line 5, in
pipe.load_lora_weights("artemonlysuno/sdxl-lora-neutral1")
File "/home/user/anaconda3/envs/3.7/lib/python3.12/site-packages/diffusers/loaders/lora_pipeline.py", line 543, in load_lora_weights
state_dict, network_alphas = self.lora_state_dict(
^^^^^^^^^^^^^^^^^^^^^
File "/home/user/anaconda3/envs/3.7/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/user/anaconda3/envs/3.7/lib/python3.12/site-packages/diffusers/loaders/lora_pipeline.py", line 698, in lora_state_dict
state_dict = _maybe_map_sgm_blocks_to_diffusers(state_dict, unet_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/anaconda3/envs/3.7/lib/python3.12/site-packages/diffusers/loaders/lora_conversion_utils.py", line 59, in _maybe_map_sgm_blocks_to_diffusers
raise ValueError(f"Checkpoint not supported because layer {layer} not supported.")
ValueError: Checkpoint not supported because layer lora_unet_label_emb_0_0.alpha not supported.
```

### System Info

Diffusers version: Version: 0.33.0.dev0
Python: 3.12.9

### Who can help?

@sayakpaul

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with _maybe_map_sgm_blocks_to_diffusers in src/diffusers/loaders/lora_conversion_utils.py, called from lora_state_dict in src/diffusers/loaders/lora_pipeline.py. Reproduce the failure with the provided pipeline and model, then determine how the lora_unet_label_emb_0_0.alpha layer should be handled; done means the checkpoint loads and the example generates an image.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
huggingface, python, pytorch
Ambito
machine-learning
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.