Instructions to use CompVis/stable-diffusion-v1-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use CompVis/stable-diffusion-v1-2 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-2", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Commit ·
6cf1aef
1
Parent(s): eb73ff2
Update README.md
Browse files
README.md
CHANGED
|
@@ -55,12 +55,6 @@ We recommend using [🤗's Diffusers library](https://github.com/huggingface/dif
|
|
| 55 |
pip install --upgrade diffusers transformers scipy
|
| 56 |
```
|
| 57 |
|
| 58 |
-
Run this command to log in with your HF Hub token if you haven't before:
|
| 59 |
-
|
| 60 |
-
```bash
|
| 61 |
-
huggingface-cli login
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
Running the pipeline with the default PNDM scheduler:
|
| 65 |
|
| 66 |
```python
|
|
@@ -89,7 +83,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
|
| 93 |
pipe = pipe.to(device)
|
| 94 |
|
| 95 |
prompt = "a photo of an astronaut riding a horse on mars"
|
|
|
|
| 55 |
pip install --upgrade diffusers transformers scipy
|
| 56 |
```
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
Running the pipeline with the default PNDM scheduler:
|
| 59 |
|
| 60 |
```python
|
|
|
|
| 83 |
```py
|
| 84 |
import torch
|
| 85 |
|
| 86 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
| 87 |
pipe = pipe.to(device)
|
| 88 |
|
| 89 |
prompt = "a photo of an astronaut riding a horse on mars"
|