Skip to content

W2GenAI-Lab/LucidFlux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

72 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽจ LucidFlux:
Caption-Free Universal Image Restoration with a Large-Scale Diffusion Transformer


abs_image


๐Ÿ“ฐ News & Updates

[2025.10.07] โ€” Thanks to smthemex for developing ComfyUI_LucidFlux, which enables LucidFlux to run with as little as 8 GBโ€“12 GB of memory through the ComfyUI integration.

[2025.10.06] -- LucidFlux now supports offload and precomputed prompt embeddings, eliminating the need to load T5 or CLIP during inference. These improvements reduce memory usage significantly โ€” inference can now run with as little as 28 GB VRAM, greatly enhancing deployment efficiency.

[2025.10.05] -- LucidFlux has been officially added to the Fal AI Playground! You can now try the online demo and access the Fal API directly here:
๐Ÿ‘‰ LucidFlux on Fal AI


Let us know if this works!

๐Ÿ‘ฅ Authors

Song Fei1*, Tian Ye1*โ€ก, Lujia Wang1 , Lei Zhu1,2โ€ 

1The Hong Kong University of Science and Technology (Guangzhou)
2The Hong Kong University of Science and Technology

*Equal Contribution, โ€กProject Leader, โ€ Corresponding Author


๐ŸŒŸ What is LucidFlux?

LucidFlux is a caption-free universal image restoration framework that leverages a lightweight dual-branch conditioner and adaptive modulation to guide a large diffusion transformer (Flux.1) with minimal overhead, achieving robust, high-fidelity restoration without relying on text prompts or MLLM captions.

๐Ÿ“Š Performance Benchmarks

๐Ÿ“ˆ Quantitative Results

quantitative_comparison quantitative_comparison_commercial

๐ŸŽญ Gallery & Examples

๐ŸŽจ LucidFlux Gallery


๐Ÿ” Comparison with Open-Source Methods

LQ SinSR SeeSR SUPIR DreamClear Ours
Show more examples

๐Ÿ’ผ Comparison with Commercial Models

LQ HYPIR-FLUX Topaz Seedream 4.0 MeiTu SR Gemini-NanoBanana Ours
Show more examples

๐Ÿ—๏ธ Model Architecture

LucidFlux Framework Overview
Caption-Free Universal Image Restoration with a Large-Scale Diffusion Transformer

Our unified framework consists of four critical components in the training workflow:

๐ŸŽจ Dual-Branch Conditioner for Low-Quality Image Conditioning

๐ŸŽฏ Timestep and Layer-Adaptive Condition Injection

๐Ÿ”„ Semantic Priors from Siglip for Caption-Free Semantic Alignment

๐Ÿ”ค Scaling Up Real-world High-Quality Data for Universal Image Restoration

๐Ÿš€ Quick Start

โš ๏ธ The default setup requires roughly 28 GB of GPU VRAM.

๐Ÿ”ง Installation

# Clone the repository
git clone https://github.com/W2GenAI-Lab/LucidFlux.git
cd LucidFlux

# Create conda environment
conda create -n lucidflux python=3.11
conda activate lucidflux

# Install PyTorch (CUDA 12.8 wheels)
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128

# Install remaining dependencies
pip install -r requirements.txt
pip install --upgrade timm

Inference

Prepare models in 2 steps, then run a single command.

  1. Login to Hugging Face (required for gated FLUX.1-dev). Skip if already logged-in.
python -m tools.hf_login --token "$HF_TOKEN"
  1. Download required weights to fixed paths and export env vars
# FLUX.1-dev (flow+ae), SwinIR prior, T5, CLIP, SigLIP and LucidFlux checkpoint to ./weights
python -m tools.download_weights --dest weights

# Exports FLUX_DEV_FLOW/FLUX_DEV_AE to your shell (Linux/macOS)
source weights/env.sh

# Windows: open `weights\env.sh`, replace each leading `export` with `set`, then paste those commands into Command Prompt

Run inference (uses fixed relative paths):

bash inference.sh

โ„น๏ธ LucidFlux builds on Flux-based generative priors. Restored images can differ from the low-quality input because the model removes degradations and hallucinates realistic details by design. Visual discrepancies are expected and indicate the generative nature of the method.

You can also obtain results of LucidFlux on RealSR and RealLQ250 from Hugging Face: LucidFlux.


๐Ÿš€ Updates

For the purpose of fostering research and the open-source community, we plan to open-source the entire project, encompassing training, inference, weights, etc. Thank you for your patience and support! ๐ŸŒŸ

  • Release github repo.
  • Release inference code.
  • Release model checkpoints.
  • Release arXiv paper.
  • Release training code.
  • Release the data filtering pipeline.

๐Ÿ“ Citation

If you find LucidFlux useful for your research, please cite our report:

@article{fei2025lucidflux,
  title={LucidFlux: Caption-Free Universal Image Restoration via a Large-Scale Diffusion Transformer},
  author={Fei, Song and Ye, Tian and Wang, Lujia and Zhu, Lei},
  journal={arXiv preprint arXiv:2509.22414},
  year={2025}
}

๐Ÿชช License

The provided code and pre-trained weights are licensed under the FLUX.1 [dev].

๐Ÿ™ Acknowledgments

  • This code is based on FLUX. Some code are brought from DreamClear, x-flux. We thank the authors for their awesome work.

  • ๐Ÿ›๏ธ Thanks to our affiliated institutions for their support.

  • ๐Ÿค Special thanks to the open-source community for inspiration.


๐Ÿ“ฌ Contact

For any questions or inquiries, please reach out to us:

  • Song Fei: sfei285@connect.hkust-gz.edu.cn
  • Tian Ye: tye610@connect.hkust-gz.edu.cn

๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ WeChat Group

็‚นๅ‡ปๅฑ•ๅผ€ไบŒ็ปด็ ๏ผˆWeChat Group QR Code๏ผ‰

WeChat Group QR

ๅฆ‚ๆžœ็พคไบŒ็ปด็ ่ฟ‡ๆœŸ๏ผŒ็‚นๅ‡ปๅฑ•ๅผ€ไฝœ่€…ๅพฎไฟกไบŒ็ปด็ ๏ผˆAuthor WeChat QR Code๏ผ‰

WeChat Group QR

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •