Error on macbook with'mps') #53

by williamhCode - opened
import torch
from diffusers import StableDiffusionPipeline

pipe = StableDiffusionPipeline.from_pretrained('hakurei/waifu-diffusion', torch_dtype=torch.float32)
pipe ='mps')


prompt = "test"

_ = pipe(prompt, num_inference_steps=1)

image = pipe(prompt, guidance_scale=6).images[0]"test.png")

This throws the error

line 11, in <module>
    _ = pipe(prompt, num_inference_steps=1)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/waifu/lib/python3.10/site-packages/torch/autograd/", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/waifu/lib/python3.10/site-packages/diffusers/pipelines/stable_diffusion/", line 362, in __call__
    timesteps_tensor =
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

It works if I use runwayml/stable-diffusion-v1-5 instead of waifu diffusion.
This issue might be related,, but it has been fixed. This issue only happens when I use waifu-diffusion, not stable-diffusion