patrickvonplaten
commited on
Commit
·
bebf07d
1
Parent(s):
739635a
Update README.md
Browse files
README.md
CHANGED
@@ -53,12 +53,6 @@ We recommend using [🤗's Diffusers library](https://github.com/huggingface/dif
|
|
53 |
pip install --upgrade diffusers transformers scipy
|
54 |
```
|
55 |
|
56 |
-
Run this command to log in with your HF Hub token if you haven't before:
|
57 |
-
|
58 |
-
```bash
|
59 |
-
huggingface-cli login
|
60 |
-
```
|
61 |
-
|
62 |
Running the pipeline with the default PNDM scheduler:
|
63 |
|
64 |
```python
|
@@ -70,12 +64,12 @@ model_id = "CompVis/stable-diffusion-v1-1"
|
|
70 |
device = "cuda"
|
71 |
|
72 |
|
73 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id
|
74 |
pipe = pipe.to(device)
|
75 |
|
76 |
prompt = "a photo of an astronaut riding a horse on mars"
|
77 |
with autocast("cuda"):
|
78 |
-
image = pipe(prompt
|
79 |
|
80 |
image.save("astronaut_rides_horse.png")
|
81 |
```
|
@@ -87,7 +81,7 @@ If you are limited by GPU memory and have less than 10GB of GPU RAM available, p
|
|
87 |
```py
|
88 |
import torch
|
89 |
|
90 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16
|
91 |
pipe = pipe.to(device)
|
92 |
|
93 |
prompt = "a photo of an astronaut riding a horse on mars"
|
|
|
53 |
pip install --upgrade diffusers transformers scipy
|
54 |
```
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
Running the pipeline with the default PNDM scheduler:
|
57 |
|
58 |
```python
|
|
|
64 |
device = "cuda"
|
65 |
|
66 |
|
67 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id)
|
68 |
pipe = pipe.to(device)
|
69 |
|
70 |
prompt = "a photo of an astronaut riding a horse on mars"
|
71 |
with autocast("cuda"):
|
72 |
+
image = pipe(prompt)["sample"][0]
|
73 |
|
74 |
image.save("astronaut_rides_horse.png")
|
75 |
```
|
|
|
81 |
```py
|
82 |
import torch
|
83 |
|
84 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
85 |
pipe = pipe.to(device)
|
86 |
|
87 |
prompt = "a photo of an astronaut riding a horse on mars"
|