huggingface / huggingface/diffusers
Loading loras on "text_pipe" of a modular pipeline fails
- Lenguaje dominante
- Python
- Estrellas
- 34.5k
- Forks
- 7.3k
- Merge medio
- 3 d 3 h
- PR fusionados (30 d)
- 91
Descripción
### 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
Guía de contribución
Línea de trabajo
Comienza con el ejemplo de ModularPipeline usando text_blocks.init_pipeline(), load_components(), load_lora_weights() y set_adapters(). Rastrea el AttributeError en src/diffusers/configuration_utils.py:176 y compara este recorrido con el ejemplo funcional de Flux2Pipeline. La tarea está terminada cuando text_pipe pueda cargar y activar la LoRA sin el error por la falta del atributo transformer.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python, pytorch
- Área
- machine-learning
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100