patrickvonplaten
commited on
Commit
•
6f8cdb5
1
Parent(s):
dfa8b92
Update README.md
Browse files
README.md
CHANGED
@@ -43,17 +43,17 @@ pip install --upgrade git+https://github.com/huggingface/diffusers.git transform
|
|
43 |
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to EulerDiscreteScheduler):
|
44 |
|
45 |
```python
|
46 |
-
from diffusers import StableDiffusionPipeline,
|
47 |
|
48 |
-
model_id = "stabilityai/stable-diffusion-2"
|
49 |
|
50 |
# Use the Euler scheduler here instead
|
51 |
-
|
52 |
-
pipe =
|
53 |
pipe = pipe.to("cuda")
|
54 |
|
55 |
prompt = "a photo of an astronaut riding a horse on mars"
|
56 |
-
image = pipe(prompt
|
57 |
|
58 |
image.save("astronaut_rides_horse.png")
|
59 |
```
|
|
|
43 |
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to EulerDiscreteScheduler):
|
44 |
|
45 |
```python
|
46 |
+
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
|
47 |
|
48 |
+
model_id = "stabilityai/stable-diffusion-2-1"
|
49 |
|
50 |
# Use the Euler scheduler here instead
|
51 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
52 |
+
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
53 |
pipe = pipe.to("cuda")
|
54 |
|
55 |
prompt = "a photo of an astronaut riding a horse on mars"
|
56 |
+
image = pipe(prompt).images[0]
|
57 |
|
58 |
image.save("astronaut_rides_horse.png")
|
59 |
```
|