huggingface / huggingface/diffusers
Loading loras on "text_pipe" of a modular pipeline fails
- Lingua principale
- Python
- Stelle
- 34.5k
- Fork
- 7.3k
- Merge medio
- 3g 3h
- PR unite (30g)
- 91
Descrizione
### Describe the bug
The following code works:
```python
import torch
from diffusers import Flux2Pipeline
pipe = Flux2Pipeline.from_pretrained("black-forest-labs/FLUX.2-dev", torch_dtype=torch.bfloat16)
pipe.load_lora_weights("flux.2-turbo-lora.safetensors")
```
but on modular it doesn't:
```python
import torch
from diffusers import ModularPipeline
pipe = ModularPipeline.from_pretrained("black-forest-labs/FLUX.2-dev")
blocks = pipe.blocks
text_blocks = blocks.sub_blocks.pop("text_encoder")
text_pipe = text_blocks.init_pipeline("black-forest-labs/FLUX.2-dev")
text_pipe.load_components(torch_dtype=torch.bfloat16)
text_pipe.load_lora_weights("flux.2-turbo-lora.safetensors")
text_pipe.set_adapters(["default"], adapter_weights=[1])
```
The lora is found here: https://huggingface.co/fal/FLUX.2-dev-Turbo/blob/main/flux.2-turbo-lora.safetensors
### Logs
```shell
src/diffusers/configuration_utils.py", line 176, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'Flux2ModularPipeline' object has no attribute 'transformer'. Did you mean: 'transformer_name'?
```
### System Info
Latest commit of Diffusers 71a6fd9f0df04d3764dfa999268a05d87903a85a
### Who can help?
@yiyixuxu @DN6 @sayakpaul
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con l’esempio di ModularPipeline usando text_blocks.init_pipeline(), load_components(), load_lora_weights() e set_adapters(). Traccia l’AttributeError in src/diffusers/configuration_utils.py:176 e confronta questo percorso con l’esempio funzionante di Flux2Pipeline. Il lavoro è completato quando text_pipe può caricare e attivare la LoRA senza l’errore relativo all’attributo transformer mancante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, pytorch
- Ambito
- machine-learning
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100