model.to('mps') or ('mps:0') produces wrong results
RELNO opened this issue · 0 comments
RELNO commented
On Apple M1 (latest diffusers etc) following this tutorial:
https://raw.githubusercontent.com/replicate/latent-consistency-model/main/main.py
when creating pipe:
pipe = DiffusionPipeline.from_pretrained("SimianLuo/LCM_Dreamshaper_v7")
pipe.to(torch_dtype=torch.float32).to('mps:0')
a fast inference results with:
however this pipe:
pipe = DiffusionPipeline.from_pretrained("SimianLuo/LCM_Dreamshaper_v7")
pipe.to(torch_dtype=torch.float32)
Full code for reference:
from diffusers import DiffusionPipeline
import torch
pipe = DiffusionPipeline.from_pretrained("SimianLuo/LCM_Dreamshaper_v7")
pipe.to(torch_dtype=torch.float32) # <--- .to('mps:0') goes here
prompt = "a beautiful apple floating in outer space, like a planet"
images = pipe(
prompt=prompt,
num_inference_steps=4,
guidance_scale=8,
lcm_origin_steps=50,
num_images_per_prompt=1,
width=512,
height=512,
).images[0]
images