Efficient inference implementation for the Flux architecture.
Developed by Huang Yongqing for the CV course at Sun Yat-sen University.
This repository contains the inference pipeline for the Flux model. It provides optimized scripts to run image generation tasks efficiently using local environments.
✨ Key Feature: The project supports both Gradio (Web UI) and Streamlit (Dashboard) for flexible demonstration.
Due to GitHub's file size limits, the model weights (.safetensors) are hosted on my Hugging Face Model repository.
The full training and validation datasets (FLUX & SDXL) are hosted on my Hugging Face Dataset repository.
👉 Access Dataset here ---
After downloading weights, please organize the files in the checkpoints/ directory as follows:
checkpoints/ ├── flux1-dev.safetensors <-- Main Model (23.8GB) └── ae.safetensors <-- AutoEncoder (335MB) Clone the repository and install dependencies:
# It is recommended to use conda or venv pip install -r requirements.txtChoose your preferred interface style:
| Interface Type | Command | Description |
|---|---|---|
| Gradio | python demo_gr.py | Interactive Web UI, suitable for quick testing. |
| Streamlit | streamlit run demo_st.py | Dashboard style, better for presentation. |
. ├── src/ # 🧠 Core implementation logic ├── assets/ # 🎨 Images and static assets ├── checkpoints/ # ⚖️ Model weights (Download from HF) ├── output/ # 🖼️ Generated results (Auto-created) ├── demo_gr.py # 🚀 Gradio startup script ├── demo_st.py # 🚀 Streamlit startup script └── requirements.txt # 📦 Dependency list![]() | Huang Yongqing Sun Yat-sen University (SYSU) 📧 huangyq296@mail2.sysu.edu.cn 🐙 @masktrump19-sudo |
This project is for academic and educational purposes only. The Flux model architecture and weights are properties of their respective owners (Black Forest Labs).
