New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diffusers 0.7.0 - Torch Accelerator - "import OnnxStableDiffusionPipeline" results in Traceback Error (DmlExecutionProvider) #1127
Comments
@anton-l verified that this has been fixed in 0.7.1 Patch via pull#1134
Note:
|
Actually the issue is still exist for me with 0.71: |
@teddybee you need to remove the accelerate package
|
@averad Thank you, its working now. |
Note that from @anton-l could you maybe check if you can reproduce this error with from diffusers import OnnxStableDiffusionPipeline
height=512
width=512
num_inference_steps=50
guidance_scale=7.5
eta=0.0
prompt = "a photo of an astronaut riding a horse on mars"
negative_prompt="bad hands, blurry"
pipe = OnnxStableDiffusionPipeline.from_pretrained("./stable-diffusion-v1-5", revision="onnx", provider="DmlExecutionProvider", device_map="auto")
image = pipe(prompt, height, width, num_inference_steps, guidance_scale, negative_prompt, eta).images[0]
image.save("astronaut_rides_horse.png") ? Also @pcuenca @anton-l, we should not get this error when having accelerate installed and not using ONNX on Mac or Windows no? E.g. the following should always work with accelerate installed on all Linux, Windows and Mac: import torch
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
pipe = pipe.to("cuda")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0] @anton-l @pcuenca could we maybe verify this? If it doesn't work we need to adapt the warning. |
@patrickvonplaten the Windows API does not implement The quick solution is to not import |
@patrickvonplaten It works on macOS with accelerate versions 0.13.2 and 0.14 from |
The cause is in torch 1.13, not Accelerate. Downgrading PyTorch to 1.12 should fix the issue. |
Ah, sorry for missing that, thanks @sgugger! Linking the issue to track: |
Intro
Diffusers provides a Stable Diffusion pipeline compatible with the ONNX Runtime. This allows you to run Stable Diffusion on any hardware that supports ONNX (including CPUs), and where an accelerated version of PyTorch is not available.
Describe the bug
Calling "from diffusers import OnnxStableDiffusionPipeline" results in Traceback Error when using diffusers 0.7.0
Diffusers 0.7.0 now requires the accelerate library be installed. Accelerate breaks onnxruntime-directml (Windows)
Removing accelerate and installing diffusers==0.6.0 fixes the issue.
Please remove the requirement to install accelerate and only use it if its appropriate for the hardware being used.
Reproduction
run sample code:
Logs
After installing accelerate:
System Info
Windows 11
Python 3.10.x
Diffusers 0.7.0
Transformers 4.24.0
Torch 1.13.0
Onnxruntime 1.13.1
Onnxruntime-directml 1.13.1
The text was updated successfully, but these errors were encountered: