Instructions to use Beckham808/LightGen with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Beckham808/LightGen with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Beckham808/LightGen", 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
- Local Apps Settings
- Draw Things
- DiffusionBee
| license: mit | |
| library_name: diffusers | |
| pipeline_tag: text-to-image | |
| # LightGen: Efficient Image Generation through Knowledge Distillation and Direct Preference Optimization | |
| <p align="center"> | |
| <img src="https://github.com/XianfengWu01/LightGen/blob/main/demo/demo.png" width="720"> | |
| </p> | |
| ## About | |
| This model (LightGen) introduces a novel pre-train pipeline for text-to-image models. It uses knowledge distillation (KD) and Direct Preference Optimization (DPO) to achieve efficient image generation. Drawing inspiration from data KD techniques, LightGen distills knowledge from state-of-the-art text-to-image models into a compact Masked Autoregressive (MAR) architecture with only $0.7B$ parameters. | |
| It is based on [this paper](https://arxiv.org/abs/2503.08619), code release on [this github repo](https://github.com/XianfengWu01/LightGen). | |
| Currently, we just release some checkpoint without DPO | |
| ## 🦉 ToDo List | |
| - [ ] Release Complete Checkpoint. |