huggingface / huggingface/diffusers

Unloading multiple loras: norms do not return to their original values

Open
#10,745 26 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

When unloading from multiple loras on flux pipeline, I believe that the norm layers are not restored [here](https://github.com/huggingface/diffusers/blob/464374fb87610c53b2cf81e08d3df628fada3ce4/src/diffusers/loaders/lora_pipeline.py#L1575).

Shouldn't we have:

```python
if len(transformer_norm_state_dict) > 0:
original_norm_layers_state_dict = self._load_norm_into_transformer(
transformer_norm_state_dict,
transformer=transformer,
discard_original_layers=False,
)
if not hasattr(transformer, "_transformer_norm_layers"):
transformer._transformer_norm_layers = original_norm_layers_state_dict
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.