Skip to content

Commit

Permalink
add mps to diffusers
Browse files Browse the repository at this point in the history
  • Loading branch information
arunpatro committed Jun 7, 2023
1 parent acda7f2 commit 28da4c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions outlines/models/hf_diffusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def call_stable_diffusion_pipeline(
pipe = StableDiffusionPipeline.from_pretrained(model_name)
if torch.cuda.is_available():
pipe = pipe.to("cuda")
elif torch.backends.mps.is_available():
pipe = pipe.to("mps")

images = pipe(prompt, num_images_per_prompt=samples).images
if not isinstance(images, list):
Expand Down

0 comments on commit 28da4c5

Please sign in to comment.