with Hugging Face Pipelines
diffusers: A Python library maintained at 🤗
Providing open and responsible access to pre-trained diffusion models.
Democratizing the ecosystem of diffusion models by making them easy to use.
Note that there are differences between Mac silicon and Windows.
model_id = "runwayml/stable-diffusion-v1-5"
pipeline = StableDiffusionPipeline.from_pretrained(model_id)
pipeline = pipeline.to('mps')
# Recommended if your computer has < 64 GB of RAM
pipeline.enable_attention_slicing()
image = pipeline(
"An astronaut floating through space while plying the guitar").images[0]
image.save("../images/diffusion_astronaut.png")Congratulations! You have completed this tutorial 👍
Next, you may want to go back to the lab’s website
Jan Kirenz