Possible to run on AMD?

#9
by Bulldeawh - opened

Hello!
I tried to run this on AMD RX 580 (8 GB) on Windows 10, but it does not seem to work.
I converted the model into onnx and ran the commands, but I get these errors:

"2022-12-22 23:27:50.7578754 [W:onnxruntime:, inference_session.cc:490 onnxruntime::InferenceSession::RegisterExecutionProvider] Having memory pattern enabled is not supported while using the DML Execution Provider. So disabling it for this session since it uses the DML Execution Provider.
2022-12-22 23:27:53.0598830 [W:onnxruntime:, inference_session.cc:490 onnxruntime::InferenceSession::RegisterExecutionProvider] Having memory pattern enabled is not supported while using the DML Execution Provider. So disabling it for this session since it uses the DML Execution Provider.
2022-12-22 23:27:53.5751470 [W:onnxruntime:, inference_session.cc:490 onnxruntime::InferenceSession::RegisterExecutionProvider] Having memory pattern enabled is not supported while using the DML Execution Provider. So disabling it for this session since it uses the DML Execution Provider.
2022-12-22 23:28:02.2499282 [W:onnxruntime:, inference_session.cc:490 onnxruntime::InferenceSession::RegisterExecutionProvider] Having memory pattern enabled is not supported while using the DML Execution Provider. So disabling it for this session since it uses the DML Execution Provider.
Traceback (most recent call last):
File "C:...\t2i.py", line 14, in
image = pipe(prompt, num_inference_steps=steps, guidance_scale=scale).images[0]
File "C:...\diffusers\src\diffusers\pipelines\stable_diffusion\pipeline_onnx_stable_diffusion.py", line 250, in call
latents = latents * np.float(self.scheduler.init_noise_sigma)
File "C:...\Desktop\PythonInOffice...\art\lib\site-packages\numpy_init_.py", line 284, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'float'"


Tried using this from a youtube channel (pythoninoffice):

from diffusers import OnnxStableDiffusionPipeline
#from PIL import Image

#baseImage = Image.open(r"in.jpg").convert("RGB") # opens an image directly from the script's location and converts to RGB color profile
#baseImage = baseImage.resize((768,512))

prompt = "A fantasy landscape, trending on artstation"
denoiseStrength = 0.8 # a float number from 0 to 1 - decreasing this number will increase result similarity with baseImage
steps = 25
scale = 7.5

pipe = OnnxStableDiffusionPipeline.from_pretrained(r"C:\Users...\Desktop\PythonInOffice...\onnx",
provider="DmlExecutionProvider")
image = pipe(prompt, strength=denoiseStrength, num_inference_steps=steps, guidance_scale=scale).images[0]
image.save("t2i.png")

Thanks for the answers! I am not a coder or something, but I try to figure out things.

dreamlike-art org

Sorry, but I can't help with this

not-someone changed discussion status to closed

Sorry, but I can't help with this

I understand, thanks!
Do you know a place where someone could know about this?

dreamlike-art org

You can try asking in the official SD discord: https://discord.gg/stablediffusion

Sign up or log in to comment