huggingface / huggingface/diffusers

Another comfy-ui compatible FLUX1.dev LoRA fails to load

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

Description

### Describe the bug

https://civitai.com/models/631986/xlabs-flux-realism-lora

This LoRA fails to load. Specifically, I get a `ValueError: Incompatible keys detected`.

### Reproduction

```py
import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to('cuda')

pipe.load_lora_weights('/data/models/flux_realism_lora.safetensors', adapter_name="wow_details")

prompt = "a tiny astronaut hatching from an egg on the moon"
out = pipe(
prompt=prompt,
guidance_scale=3.5,
height=1024,
width=1024,
num_inference_steps=25,
).images[0]
out.save("image.png")
```

### Logs

```shell
ValueError: Incompatible keys detected
```

### System Info

Latest commit on main

### Who can help?

@sayakpaul

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.