# Diffuser error trying to load lora

**URL:** <https://discuss.huggingface.co/t/diffuser-error-trying-to-load-lora/54166>\
**Category:** Beginners\
**Created:** [September 8, 2023, 10:39pm UTC](https://discuss.huggingface.co/t/diffuser-error-trying-to-load-lora/54166 "2023-09-08T22:39:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adriey](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@adriey](https://discuss.huggingface.co/u/adriey)\
**Post date:** [September 8, 2023, 10:39pm UTC](https://discuss.huggingface.co/t/diffuser-error-trying-to-load-lora/54166/1 "2023-09-08T22:39:47Z")

</div>

im running stable difusion on termux android and everything goes well till i tried to use loras and i have to update diffuser to 0.30 and now im getting this error:

File “/root/app.py”, line 1, in   
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler  
ImportError: cannot import name ‘EulerDiscreteScheduler’ from ‘diffusers’ (/root/.venv/lib/python3.11/site-packages/diffusers/ **init**.py)  
(.venv) root@localhost:~# nano app.py  
(.venv) root@localhost:~# python3 app.py  
Traceback (most recent call last):  
File “/root/app.py”, line 1, in   
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler  
ImportError: cannot import name ‘EulerDiscreteScheduler’ from ‘diffusers’ (/root/.venv/lib/python3.11/site-packages/diffusers/ **init**.py)  
(.venv) root@localhost:~# nano app.py  
(.venv) root@localhost:~#

Somebody knows what should i do?

Here more info:

I was trying to use this .py

from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler

# Use local models

model\_id = “./stable-diffusion-v1-5”

# Use Euler sampling

scheduler = EulerDiscreteScheduler.from\_pretrained(model\_id, subfolder=“scheduler”)

#scheduler = DPMSolverMultistepScheduler.from\_config(pipe.scheduler.config)

# Enable low memory usage, set image size to 320x320 and steps to 50.

pipe = StableDiffusionPipeline.from\_pretrained(model\_id, scheduler=scheduler, low\_cpu\_mem\_usage=True)

pipe.unet.load\_attn\_procs(“./Insertion.safetensors”, local\_files\_only=True)

# Bypass NSFW filter

#pipe.safety\_checker = lambda images, clip\_input: (images, False)

pipe.safety\_checker=None

pipe.feature\_extractor=None

# Prompts

prompt = “a roman soldier”

nprompt = “simple background, logo, anime, deformed, disfigured, poorly drawn, bad anatomy, wrong anatomy, mutated hands and fingers, disconnected limbs, mutation, mutated, ugly, blurry, amputation. tattoo, 3d animation (semi-realistic and anime and illustration and 3d rendering and drawing) deformations, mutant, old, disfigured, amputee, mutated, mutation, cropped, worst (((censored))), fat, long body, poorly drawn face, mole, pants,”

# Start generating the

image = pipe(prompt, negative\_prompt=nprompt, num\_inference\_steps=200, width=240, height=240).images[0]

# Save the image

image.save(“result.png”)

pipe.enable\_vae\_tiling()

Im getting an error about eulerschedule but if i delete the eulerschedule i get this:

File “/root/app.py”, line 22, in

```auto
pipe.unet.load_attn_procs("./Insertion.safetensors", local_files_only=True)

```

File “/usr/local/lib/python3.11/dist-packages/diffusers/loaders.py”, line 366, in load\_attn\_procs attn\_processor = getattr(attn\_processor, sub\_key)

File “/usr/local/lib/python3.11/dist-packages/diffusers/models/modeling\_utils.py”, line 185, in getattr

```auto
return super(). __getattr__ (name)
       ^^^^^^^^^^^^^^^^^^^^^^^^^

```

File “/usr/local/lib/python3.11/dist-packages/torch/nn/modules/module.py”, line 1614, in getattr

````auto
raise AttributeError("'{}' object has no attribute '{}'".format(
```AttributeError: 'UNet2DConditionModel' object has no attribute ''

Can somebody help me please
````

---

<div class="post-metadata">

**Author:** ![ClayAtlas](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/clayatlas/32/19795_2.png) [@ClayAtlas](https://discuss.huggingface.co/u/ClayAtlas)\
**Post date:** [September 25, 2023, 1:23pm UTC](https://discuss.huggingface.co/t/diffuser-error-trying-to-load-lora/54166/2 "2023-09-25T13:23:55Z")

</div>

What is the version of your `diffusers`?

I got the same error likes yours, but after I using:  
`pipeline.load_lora_weights("./models/lora_models/", weight_name="XXX.safetensors")`

It worked for me.
