Instructions to use ceyda/ddpm-ema-butterflies-64 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ceyda/ddpm-ema-butterflies-64 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ceyda/ddpm-ema-butterflies-64", 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
add usage code
Browse files
README.md
CHANGED
|
@@ -15,14 +15,25 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 15 |
## Model description
|
| 16 |
|
| 17 |
This diffusion model is trained with the [🤗 Diffusers](https://github.com/huggingface/diffusers) library
|
| 18 |
-
on the `huggan/smithsonian_butterflies_subset` dataset.
|
| 19 |
|
| 20 |
## Intended uses & limitations
|
| 21 |
|
| 22 |
#### How to use
|
| 23 |
|
| 24 |
```python
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
```
|
| 27 |
|
| 28 |
#### Limitations and bias
|
|
|
|
| 15 |
## Model description
|
| 16 |
|
| 17 |
This diffusion model is trained with the [🤗 Diffusers](https://github.com/huggingface/diffusers) library
|
| 18 |
+
on the `huggan/smithsonian_butterflies_subset` dataset. Using this [script](https://github.com/huggingface/diffusers/blob/cde0ed162a127b17f1b4d4b16ff7f736cf04e690/examples/train_unconditional.py)
|
| 19 |
|
| 20 |
## Intended uses & limitations
|
| 21 |
|
| 22 |
#### How to use
|
| 23 |
|
| 24 |
```python
|
| 25 |
+
from diffusers import DDPMPipeline
|
| 26 |
+
|
| 27 |
+
model_id = "ceyda/ddpm-ema-butterflies-64"
|
| 28 |
+
|
| 29 |
+
# load model and scheduler
|
| 30 |
+
ddpm = DDPMPipeline.from_pretrained(model_id) # you can replace DDPMPipeline with DDIMPipeline or PNDMPipeline for faster inference
|
| 31 |
+
|
| 32 |
+
# run pipeline in inference (sample random noise and denoise)
|
| 33 |
+
image = ddpm()["sample"]
|
| 34 |
+
|
| 35 |
+
# save image
|
| 36 |
+
image[0].save("ddpm_generated_image.png")
|
| 37 |
```
|
| 38 |
|
| 39 |
#### Limitations and bias
|