Views
No views yet

| Model | link |
|---|---|
| koala-lightning-1.7b | https://huggingface.co/etri-vilab/koala-lightning-1.7b |
| koala-lightning-1b | https://huggingface.co/etri-vilab/koala-lightning-1b |
| koala-lightning-700m | https://huggingface.co/etri-vilab/koala-lightning-700m |
We propose a fast text-to-image model, called KOALA, by compressing SDXL's U-Net and distilling knowledge from SDXL into our model. KOALA-Lightning-700M can generate a 1024x1024 image in 0.66 seconds on an NVIDIA 4090 GPU, which is more than 4x faster than SDXL. KOALA-700M can be used as a cost-effective alternative between SDM and SDXL in limited resources.


| U-Net | SDM-v2.0 | SDXL-Base-1.0 | KOALA-1.7B | KOALA-1B | KOALA-700M |
|---|---|---|---|---|---|
| Param. | 865M | 2,567M | 1,717M | 1,161M | 782M |
| CKPT size | 3.46GB | 10.3GB | 6.4GB | 5.8GB | 3.0GB |
| Tx blocks | [1, 1, 1, 1] | [0, 2, 10] | [0, 2, 10] | [0, 2, 6] | [0, 2, 5] |
| Mid block | ✓ | ✓ | ✓ | ✓ | ✗ |
| Latency | 1.35s | 6.48s | 1.26s | 0.99s | 0.94s |

1import torch
2from diffusers import StableDiffusionXLPipeline, EulerDiscreteScheduler
3
4pipe = StableDiffusionXLPipeline.from_pretrained("etri-vilab/koala-lightning-1.7b", torch_dtype=torch.float16)
5pipe = pipe.to("cuda")
6
7# Ensure sampler uses "trailing" timesteps and "sample" prediction type.
8pipe.scheduler = EulerDiscreteScheduler.from_config(
9 pipe.scheduler.config, timestep_spacing="trailing"
10 )
11
12
13prompt = "A portrait painting of a Golden Retriever like Leonard da Vinci"
14negative = "worst quality, low quality, illustration, low resolution"
15image = pipe(prompt=prompt, negative_prompt=negative, guidance_scale=3.5, num_inference_steps=10).images[0]
161@misc{Lee@koala,
2 title={KOALA: Empirical Lessons Toward Memory-Efficient and Fast Diffusion Models for Text-to-Image Synthesis},
3 author={Youngwan Lee and Kwanyong Park and Yoorhim Cho and Yong-Ju Lee and Sung Ju Hwang},
4 year={2023},
5 eprint={2312.04005},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV}
8}