Skip to content

Instantly share code, notes, and snippets.

@fragmede
Created August 30, 2022 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fragmede/ff94d6d1795441a4c72f5c47b0343c59 to your computer and use it in GitHub Desktop.
Save fragmede/ff94d6d1795441a4c72f5c47b0343c59 to your computer and use it in GitHub Desktop.
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained(
"CompVis/stable-diffusion-v1-4",
use_auth_token=True
).to("mps")
prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt)["sample"][0]
image.save("astronaut_rides_horse.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment