Instructions to use google/ddpm-cifar10-32 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use google/ddpm-cifar10-32 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("google/ddpm-cifar10-32", 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
Commit ·
ff056c9
1
Parent(s): 826ce2e
Update README.md
Browse files
README.md
CHANGED
|
@@ -39,10 +39,10 @@ model_id = "google/ddpm-cifar10-32"
|
|
| 39 |
ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
|
| 40 |
|
| 41 |
# run pipeline in inference (sample random noise and denoise)
|
| 42 |
-
image = ddpm().
|
| 43 |
|
| 44 |
# save image
|
| 45 |
-
image
|
| 46 |
```
|
| 47 |
|
| 48 |
For more in-detail information, please have a look at the [official inference example](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/diffusers_intro.ipynb)
|
|
|
|
| 39 |
ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
|
| 40 |
|
| 41 |
# run pipeline in inference (sample random noise and denoise)
|
| 42 |
+
image = ddpm().images[0]
|
| 43 |
|
| 44 |
# save image
|
| 45 |
+
image.save("ddpm_generated_image.png")
|
| 46 |
```
|
| 47 |
|
| 48 |
For more in-detail information, please have a look at the [official inference example](https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/diffusers_intro.ipynb)
|