Update README.md
Browse files
README.md
CHANGED
@@ -22,13 +22,19 @@ on the `imagefolder` dataset.
|
|
22 |
#### How to use
|
23 |
|
24 |
```python
|
25 |
-
|
|
|
26 |
|
27 |
model_id = "uumlaut/ddpm-vangogh-128"
|
28 |
|
|
|
29 |
ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
|
30 |
|
|
|
31 |
image = ddpm().images[0]
|
|
|
|
|
|
|
32 |
```
|
33 |
|
34 |
#### Limitations and bias
|
|
|
22 |
#### How to use
|
23 |
|
24 |
```python
|
25 |
+
# !pip install diffusers
|
26 |
+
from diffusers import DDPMPipeline, DDIMPipeline, PNDMPipeline
|
27 |
|
28 |
model_id = "uumlaut/ddpm-vangogh-128"
|
29 |
|
30 |
+
# load model and scheduler
|
31 |
ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
|
32 |
|
33 |
+
# run pipeline in inference (sample random noise and denoise)
|
34 |
image = ddpm().images[0]
|
35 |
+
|
36 |
+
# save image
|
37 |
+
image.save("ddpm_generated_image.png")
|
38 |
```
|
39 |
|
40 |
#### Limitations and bias
|