|
--- |
|
datasets: |
|
- huggan/anime-faces |
|
language: |
|
- en |
|
library_name: diffusers |
|
tags: |
|
- anime |
|
- generative |
|
--- |
|
|
|
# anime-faces-ddpm |
|
A Denoising Diffusion Probabilistic Model (DDPM) trained to generate anime faces using [this example as a basis.](https://github.com/huggingface/diffusers/tree/main/examples/unconditional_image_generation) |
|
|
|
![image/png](https://cdn-uploads.huggingface.co/production/uploads/65e6420da97628ed6ada1cb8/wM8CUMRQRoOV0FucyRpIi.png) |
|
|
|
## Model Description |
|
|
|
This diffusion model is trained with the [🤗 Diffusers](https://github.com/huggingface/diffusers) library |
|
on the `huggan/anime-faces` dataset. |
|
|
|
## How To Use |
|
|
|
```python |
|
from diffusers import DDPMPipeline |
|
|
|
checkpoint = "sweetfelinity/anime-faces-ddpm" |
|
pipeline = DDPMPipeline.from_pretrained(checkpoint) |
|
pipeline = pipeline.to("cuda") # or "cpu" |
|
|
|
for i in range(10): |
|
image = pipeline().images[0] |
|
image.save(str(i + 1) + ".png") |
|
``` |
|
|
|
## Training Hyperparameters |
|
|
|
The following hyperparameters were used during training: |
|
- resolution=64 |
|
- train_batch_size=16 |
|
- num_epochs=30 |
|
- gradient_accumulation_steps=1 |
|
- learning_rate=1e-4 |
|
- lr_warmup_steps=500 |
|
- mixed_precision=fp16 |
|
- checkpointing_steps=2000 |
|
- save_images_epochs=4 |
|
- use_ema |
|
- adam_weight_decay=1e-6 |
|
- lr_scheduler=linear |
|
- eval_batch_size=32 |
|
|
|
## Training Results |
|
See model folder /generated-images for 100 images created by the DDPM. |
|
|