Commit
•
ef7c178
1
Parent(s):
9488afa
Simplify diffusers example (#3)
Browse files- Simplify diffusers example (404da2ef124aabbf2e45fe59f0b99423a4772a7c)
Co-authored-by: Patrick von Platen <patrickvonplaten@users.noreply.huggingface.co>
README.md
CHANGED
@@ -72,12 +72,18 @@ You can see the documentation page [here](https://huggingface.co/docs/diffusers/
|
|
72 |
|
73 |
The following example will use the fast DPM scheduler to generate an image in ca. 2 seconds on a V100.
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
```python
|
76 |
-
!pip install git+https://github.com/huggingface/diffusers.git torch transformers
|
77 |
from diffusers import AltDiffusionPipeline, DPMSolverMultistepScheduler
|
78 |
import torch
|
79 |
|
80 |
-
pipe = AltDiffusionPipeline.from_pretrained("
|
81 |
pipe = pipe.to("cuda")
|
82 |
|
83 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
|
|
72 |
|
73 |
The following example will use the fast DPM scheduler to generate an image in ca. 2 seconds on a V100.
|
74 |
|
75 |
+
First you should install diffusers main branch and some dependencies:
|
76 |
+
```
|
77 |
+
pip install git+https://github.com/huggingface/diffusers.git torch transformers sentencepiece
|
78 |
+
```
|
79 |
+
|
80 |
+
then you can run the following example:
|
81 |
+
|
82 |
```python
|
|
|
83 |
from diffusers import AltDiffusionPipeline, DPMSolverMultistepScheduler
|
84 |
import torch
|
85 |
|
86 |
+
pipe = AltDiffusionPipeline.from_pretrained("BAAI/AltDiffusion", torch_dtype=torch.float16)
|
87 |
pipe = pipe.to("cuda")
|
88 |
|
89 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|