File size: 1,642 Bytes
36b06d9 bdb2e41 36b06d9 185d2c5 bbfa73b 185d2c5 6ce077c 185d2c5 6ce077c 185d2c5 6ce077c 185d2c5 bbfa73b 185d2c5 bbfa73b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
---
license: apache-2.0
datasets:
- lambdalabs/pokemon-blip-captions
---
# Introduction
This is the example model of [Distill SDXL](https://github.com/okotaku/diffengine/tree/main/configs/distill_sd).
The training is based on [DiffEngine](https://github.com/okotaku/diffengine), the open-source toolbox for training state-of-the-art Diffusion Models with diffusers and mmengine.
# Training
```
pip install openmim
pip install git+https://github.com/okotaku/diffengine.git
mim train diffengine tiny_sd_xl_pokemon_blip.py
```
More details to my blog post:
# Dataset
I used [lambdalabs/pokemon-blip-captions](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions).
# Inference
```
import torch
from diffusers import DiffusionPipeline, UNet2DConditionModel, AutoencoderKL
checkpoint = 'takuoko/tiny_sd_xl_pokemon_blip'
prompt = 'a very cute looking pokemon with a hat on its head'
unet = UNet2DConditionModel.from_pretrained(
checkpoint, torch_dtype=torch.bfloat16
)
vae = AutoencoderKL.from_pretrained(
'madebyollin/sdxl-vae-fp16-fix',
torch_dtype=torch.bfloat16,
)
pipe = DiffusionPipeline.from_pretrained(
'stabilityai/stable-diffusion-xl-base-1.0', unet=unet, vae=vae, torch_dtype=torch.bfloat16
)
pipe.to('cuda')
image = pipe(
prompt,
num_inference_steps=50,
).images[0]
image.save('demo.png')
```
# Example result
prompt = 'a very cute looking pokemon with a hat on its head'
![image](demo.png)
# Reference
Paper: [On Architectural Compression of Text-to-Image Diffusion Models](https://arxiv.org/abs/2305.15798)
Unofficial implementation: https://github.com/segmind/distill-sd
|