Text-to-Image
Diffusers
Safetensors
StableDiffusionPipeline
stable-diffusion
stable-diffusion-diffusers
Instructions to use CompVis/stable-diffusion-v1-4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use CompVis/stable-diffusion-v1-4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", dtype=torch.bfloat16, device_map="cuda") prompt = "A high tech solarpunk utopia in the Amazon rainforest" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Commit ·
a1cda71
1
Parent(s): 11a3326
Update README.md
Browse files
README.md
CHANGED
|
@@ -89,7 +89,7 @@ If you are limited by GPU memory and have less than 10GB of GPU RAM available, p
|
|
| 89 |
```py
|
| 90 |
import torch
|
| 91 |
|
| 92 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, use_auth_token=True)
|
| 93 |
pipe = pipe.to(device)
|
| 94 |
|
| 95 |
prompt = "a photo of an astronaut riding a horse on mars"
|
|
|
|
| 89 |
```py
|
| 90 |
import torch
|
| 91 |
|
| 92 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp16", use_auth_token=True)
|
| 93 |
pipe = pipe.to(device)
|
| 94 |
|
| 95 |
prompt = "a photo of an astronaut riding a horse on mars"
|