BK-SDM-{v2-Base, v2-Small, v2-Tiny} are obtained by compressing SD-v2.1-base.
An inference code with the default PNDM scheduler and 50 denoising steps is as follows.
import torch
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("nota-ai/bk-sdm-v2-tiny", torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "a black vase holding a bouquet of roses"
image = pipe(prompt).images[0]
image.save("example.png")
Based on the U-Net architecture and distillation retraining of BK-SDM, a reduced batch size (from 256 to 128) is used in BK-SDM-v2 for faster training speeds.
The following table shows the zero-shot results on 30K samples from the MS-COCO validation split. After generating 512×512 images with the PNDM scheduler and 25 denoising steps, we downsampled them to 256×256 for evaluating generation scores.
| Model | FID↓ | IS↑ | CLIP Score↑ (ViT-g/14) | # Params, U-Net | # Params, Whole SDM |
|---|---|---|---|---|---|
| Stable Diffusion v2.1-base | 13.93 | 35.93 | 0.3075 | 0.87B | 1.26B |
| BK-SDM-v2-Base (Ours) | 15.85 | 31.70 | 0.2868 | 0.59B | 0.98B |
| BK-SDM-v2-Small (Ours) | 16.61 | 31.73 | 0.2901 | 0.49B | 0.88B |
| BK-SDM-v2-Tiny (Ours) | 15.68 | 31.64 | 0.2897 | 0.33B | 0.72B |
| Model | FID↓ | IS↑ | CLIP Score↑ (ViT-g/14) | # Params, U-Net | # Params, Whole SDM |
|---|---|---|---|---|---|
| Stable Diffusion v1.4 | 13.05 | 36.76 | 0.2958 | 0.86B | 1.04B |
| BK-SDM-Base (Ours) | 15.76 | 33.79 | 0.2878 | 0.58B | 0.76B |
| BK-SDM-Base-2M (Ours) | 14.81 | 34.17 | 0.2883 | 0.58B | 0.76B |
| BK-SDM-Small (Ours) | 16.98 | 31.68 | 0.2677 | 0.49B | 0.66B |
| BK-SDM-Small-2M (Ours) | 17.05 | 33.10 | 0.2734 | 0.49B | 0.66B |
| BK-SDM-Tiny (Ours) | 17.12 | 30.09 | 0.2653 | 0.33B | 0.50B |
| BK-SDM-Tiny-2M (Ours) | 17.53 | 31.32 | 0.2690 | 0.33B | 0.50B |
KD enables our models to mimic the SDM, yielding similar per-word attribution maps. The model without KD behaves differently, causing dissimilar maps and inaccurate generation (e.g., two sheep and unusual bird shapes).
Please follow the usage guidelines of Stable Diffusion v1.
@article{kim2023architectural,
title={BK-SDM: A Lightweight, Fast, and Cheap Version of Stable Diffusion},
author={Kim, Bo-Kyeong and Song, Hyoung-Kyu and Castells, Thibault and Choi, Shinkook},
journal={arXiv preprint arXiv:2305.15798},
year={2023},
url={https://arxiv.org/abs/2305.15798}
}
@article{kim2023bksdm,
title={BK-SDM: Architecturally Compressed Stable Diffusion for Efficient Text-to-Image Generation},
author={Kim, Bo-Kyeong and Song, Hyoung-Kyu and Castells, Thibault and Choi, Shinkook},
journal={ICML Workshop on Efficient Systems for Foundation Models (ES-FoMo)},
year={2023},
url={https://openreview.net/forum?id=bOVydU0XKC}
}
This model card is based on the Stable Diffusion v1 model card.
BK-SDM-{v2-Base, v2-Small, v2-Tiny} are obtained by compressing SD-v2.1-base.
An inference code with the default PNDM scheduler and 50 denoising steps is as follows.
import torch
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("nota-ai/bk-sdm-v2-tiny", torch_dtype=torch.float16)
pipe = pipe.to("cuda")
prompt = "a black vase holding a bouquet of roses"
image = pipe(prompt).images[0]
image.save("example.png")
Based on the U-Net architecture and distillation retraining of BK-SDM, a reduced batch size (from 256 to 128) is used in BK-SDM-v2 for faster training speeds.
The following table shows the zero-shot results on 30K samples from the MS-COCO validation split. After generating 512×512 images with the PNDM scheduler and 25 denoising steps, we downsampled them to 256×256 for evaluating generation scores.
| Model | FID↓ | IS↑ | CLIP Score↑ (ViT-g/14) | # Params, U-Net | # Params, Whole SDM |
|---|---|---|---|---|---|
| Stable Diffusion v2.1-base | 13.93 | 35.93 | 0.3075 | 0.87B | 1.26B |
| BK-SDM-v2-Base (Ours) | 15.85 | 31.70 | 0.2868 | 0.59B | 0.98B |
| BK-SDM-v2-Small (Ours) | 16.61 | 31.73 | 0.2901 | 0.49B | 0.88B |
| BK-SDM-v2-Tiny (Ours) | 15.68 | 31.64 | 0.2897 | 0.33B | 0.72B |
| Model | FID↓ | IS↑ | CLIP Score↑ (ViT-g/14) | # Params, U-Net | # Params, Whole SDM |
|---|---|---|---|---|---|
| Stable Diffusion v1.4 | 13.05 | 36.76 | 0.2958 | 0.86B | 1.04B |
| BK-SDM-Base (Ours) | 15.76 | 33.79 | 0.2878 | 0.58B | 0.76B |
| BK-SDM-Base-2M (Ours) | 14.81 | 34.17 | 0.2883 | 0.58B | 0.76B |
| BK-SDM-Small (Ours) | 16.98 | 31.68 | 0.2677 | 0.49B | 0.66B |
| BK-SDM-Small-2M (Ours) | 17.05 | 33.10 | 0.2734 | 0.49B | 0.66B |
| BK-SDM-Tiny (Ours) | 17.12 | 30.09 | 0.2653 | 0.33B | 0.50B |
| BK-SDM-Tiny-2M (Ours) | 17.53 | 31.32 | 0.2690 | 0.33B | 0.50B |
KD enables our models to mimic the SDM, yielding similar per-word attribution maps. The model without KD behaves differently, causing dissimilar maps and inaccurate generation (e.g., two sheep and unusual bird shapes).
Please follow the usage guidelines of Stable Diffusion v1.
@article{kim2023architectural,
title={BK-SDM: A Lightweight, Fast, and Cheap Version of Stable Diffusion},
author={Kim, Bo-Kyeong and Song, Hyoung-Kyu and Castells, Thibault and Choi, Shinkook},
journal={arXiv preprint arXiv:2305.15798},
year={2023},
url={https://arxiv.org/abs/2305.15798}
}
@article{kim2023bksdm,
title={BK-SDM: Architecturally Compressed Stable Diffusion for Efficient Text-to-Image Generation},
author={Kim, Bo-Kyeong and Song, Hyoung-Kyu and Castells, Thibault and Choi, Shinkook},
journal={ICML Workshop on Efficient Systems for Foundation Models (ES-FoMo)},
year={2023},
url={https://openreview.net/forum?id=bOVydU0XKC}
}
This model card is based on the Stable Diffusion v1 model card.