File size: 13,702 Bytes
9b8f636 6d0ed86 9b8f636 6d0ed86 9b8f636 6d0ed86 9b8f636 816d522 6d0ed86 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 9b8f636 816d522 6d0ed86 816d522 6d0ed86 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
---
language:
- en
license: mit
license_name: flux-1-dev
license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
tags:
- image-restoration
- diffusion
- computer-vision
- flux
pipeline_tag: image-to-image
library_name: diffusers
---
<div align="center">
<h1>π¨ LucidFlux:<br/>Caption-Free Universal Image Restoration with a Large-Scale Diffusion Transformer</h1>
###
[**π Website**](https://w2genai-lab.github.io/LucidFlux/) | [**π Paper**](https://huggingface.co/papers/2509.22414) | [**π» Code**](https://github.com/W2GenAI-Lab/LucidFlux) | [**π§© Models**](https://huggingface.co/W2GenAI/LucidFlux)
</div>
---
<img width="1420" height="1116" alt="abs_image" src="https://github.com/user-attachments/assets/791c0c60-29a6-4497-86a9-5716049afe9a" />
---
## News & Updates
---
Let us know if this works!
## π₯ Authors
> [**Song Fei**](https://github.com/FeiSong123)<sup>1</sup>\*, [**Tian Ye**](https://owen718.github.io/)<sup>1</sup>\*β‘, [**Lei Zhu**](https://sites.google.com/site/indexlzhu/home)<sup>1,2</sup>β
>
> <sup>1</sup>The Hong Kong University of Science and Technology (Guangzhou)
> <sup>2</sup>The Hong Kong University of Science and Technology
>
> \*Equal Contribution, β‘Project Leader, β Corresponding Author
---
## π What is LucidFlux?
<!-- <div align="center">
<img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/demo/demo2.png" alt="What is LucidFlux - Quick Prompt Demo" width="1200"/>
<br>
</div> -->
LucidFlux is a framework designed to perform high-fidelity image restoration across a wide range of degradations without requiring textual captions. By combining a Flux-based DiT backbone with Light-weight Condition Module and SigLIP semantic alignment, LucidFlux enables caption-free guidance while preserving structural and semantic consistency, achieving superior restoration quality.
<!-- ## π Quick Start
### π§ Installation
```bash
# Clone the repository
git clone https://github.com/ephemeral182/LucidFlux.git
cd LucidFlux
# Create conda environment
conda create -n postercraft python=3.11
conda activate postercraft
# Install dependencies
pip install -r requirements.txt
``` -->
<!-- ### π Quick Generation
Generate high-quality aesthetic posters from your prompt with `BF16` precision:
```bash
python inference.py \
--prompt "Urban Canvas Street Art Expo poster with bold graffiti-style lettering and dynamic colorful splashes" \
--enable_recap \
--num_inference_steps 28 \
--guidance_scale 3.5 \
--seed 42 \
--pipeline_path "black-forest-labs/FLUX.1-dev" \
--custom_transformer_path "LucidFlux/LucidFlux-v1_RL" \
--qwen_model_path "Qwen/Qwen3-8B"
```
If you are running on a GPU with limited memory, you can use `inference_offload.py` to offload some components to the CPU:
```bash
python inference_offload.py \
--prompt "Urban Canvas Street Art Expo poster with bold graffiti-style lettering and dynamic colorful splashes" \
--enable_recap \
--num_inference_steps 28 \
--guidance_scale 3.5 \
--seed 42 \
--pipeline_path "black-forest-labs/FLUX.1-dev" \
--custom_transformer_path "LucidFlux/LucidFlux-v1_RL" \
--qwen_model_path "Qwen/Qwen3-8B"
``` -->
<!--
### π» Gradio Web UI
We provide a Gradio web UI for LucidFlux.
```bash
python demo_gradio.py
``` -->
## π Performance Benchmarks
<div align="center">
### π Quantitative Results
<table>
<thead>
<tr>
<th>Benchmark</th>
<th>Metric</th>
<th>ResShift</th>
<th>StableSR</th>
<th>SinSR</th>
<th>SeeSR</th>
<th>DreamClear</th>
<th>SUPIR</th>
<th>LucidFlux<br/>(Ours)</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="7" style="text-align:center; vertical-align:middle;">RealSR</td>
<td style="white-space: nowrap;">CLIP-IQA+ β</td>
<td>0.5005</td>
<td>0.4408</td>
<td>0.5416</td>
<td>0.6731</td>
<td>0.5331</td>
<td>0.5640</td>
<td><b>0.7074</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">Q-Align β</td>
<td>3.1045</td>
<td>2.5087</td>
<td>3.3615</td>
<td>3.6073</td>
<td>3.0044</td>
<td>3.4682</td>
<td><b>3.7555</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">MUSIQ β</td>
<td>49.50</td>
<td>39.98</td>
<td>57.95</td>
<td>67.57</td>
<td>49.48</td>
<td>55.68</td>
<td><b>70.20</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">MANIQA β</td>
<td>0.2976</td>
<td>0.2356</td>
<td>0.3753</td>
<td>0.5087</td>
<td>0.3092</td>
<td>0.3426</td>
<td><b>0.5437</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">NIMA β</td>
<td>4.7026</td>
<td>4.3639</td>
<td>4.8282</td>
<td>4.8957</td>
<td>4.4948</td>
<td>4.6401</td>
<td><b>5.1072</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">CLIP-IQA β</td>
<td>0.5283</td>
<td>0.3521</td>
<td>0.6601</td>
<td><b>0.6993</b></td>
<td>0.5390</td>
<td>0.4857</td>
<td>0.6783</td>
</tr>
<tr>
<td style="white-space: nowrap;">NIQE β</td>
<td>9.0674</td>
<td>6.8733</td>
<td>6.4682</td>
<td>5.4594</td>
<td>5.2873</td>
<td>5.2819</td>
<td><b>4.2893</b></td>
</tr>
<tr>
<td rowspan="7" style="text-align:center; vertical-align:middle;">RealLQ250</td>
<td style="white-space: nowrap;">CLIP-IQA+ β</td>
<td>0.5529</td>
<td>0.5804</td>
<td>0.6054</td>
<td>0.7034</td>
<td>0.6810</td>
<td>0.6532</td>
<td><b>0.7406</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">Q-Align β</td>
<td>3.6318</td>
<td>3.5586</td>
<td>3.7451</td>
<td>4.1423</td>
<td>4.0640</td>
<td>4.1347</td>
<td><b>4.3935</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">MUSIQ β</td>
<td>59.50</td>
<td>57.25</td>
<td>65.45</td>
<td>70.38</td>
<td>67.08</td>
<td>65.81</td>
<td><b>73.01</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">MANIQA β</td>
<td>0.3397</td>
<td>0.2937</td>
<td>0.4230</td>
<td>0.4895</td>
<td>0.4400</td>
<td>0.3826</td>
<td><b>0.5589</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">NIMA β</td>
<td>5.0624</td>
<td>5.0538</td>
<td>5.2397</td>
<td>5.3146</td>
<td>5.2200</td>
<td>5.0806</td>
<td><b>5.4836</b></td>
</tr>
<tr>
<td style="white-space: nowrap;">CLIP-IQA β</td>
<td>0.6129</td>
<td>0.5160</td>
<td><b>0.7166</b></td>
<td>0.7063</td>
<td>0.6950</td>
<td>0.5767</td>
<td>0.7122</td>
</tr>
<tr>
<td style="white-space: nowrap;">NIQE β</td>
<td>6.6326</td>
<td>4.6236</td>
<td>5.4425</td>
<td>4.4383</td>
<td>3.8700</td>
<td><b>3.6591</b></td>
<td>3.6742</td>
</tr>
</tbody>
</table>
<!-- <img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/user_study/hpc.png" alt="User Study Results" width="1200"/> -->
</div>
---
## π Gallery & Examples
<div align="center">
### π¨ LucidFlux Gallery
---
### π Comparison with Open-Source Methods
<table>
<tr align="center">
<td width="200"><b>LQ</b></td>
<td width="200"><b>SinSR</b></td>
<td width="200"><b>SeeSR</b></td>
<td width="200"><b>SUPIR</b></td>
<td width="200"><b>DreamClear</b></td>
<td width="200"><b>Ours</b></td>
</tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/040.jpg" width="1200"></td></tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/041.jpg" width="1200"></td></tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/111.jpg" width="1200"></td></tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/123.jpg" width="1200"></td></tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/160.jpg" width="1200"></td></tr>
</table>
<details>
<summary>Show more examples</summary>
<table>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/013.jpg" width="1200"></td></tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/079.jpg" width="1200"></td></tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/082.jpg" width="1200"></td></tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/137.jpg" width="1200"></td></tr>
<tr align="center"><td colspan="6"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/comparison/166.jpg" width="1200"></td></tr>
</table>
</details>
---
### πΌ Comparison with Commercial Models
<table>
<tr align="center">
<td width="200"><b>LQ</b></td>
<td width="200"><b>HYPIR</b></td>
<td width="200"><b>Topaz</b></td>
<td width="200"><b>SeeDream 4.0</b></td>
<td width="200"><b>Gemini-NanoBanana</b></td>
<td width="200"><b>GPT-4o</b></td>
<td width="200"><b>Ours</b></td>
</tr>
<tr align="center"><td colspan="7"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/commercial_comparison/commercial_061.jpg" width="1400"></td></tr>
<tr align="center"><td colspan="7"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/commercial_comparison/commercial_094.jpg" width="1400"></td></tr>
<tr align="center"><td colspan="7"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/commercial_comparison/commercial_205.jpg" width="1400"></td></tr>
<tr align="center"><td colspan="7"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/commercial_comparison/commercial_209.jpg" width="1400"></td></tr>
</table>
<details>
<summary>Show more examples</summary>
<table>
<tr align="center"><td colspan="7"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/commercial_comparison/commercial_062.jpg" width="1400"></td></tr>
<tr align="center"><td colspan="7"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/commercial_comparison/commercial_160.jpg" width="1400"></td></tr>
<tr align="center"><td colspan="7"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/commercial_comparison/commercial_111.jpg" width="1400"></td></tr>
<tr align="center"><td colspan="7"><img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/commercial_comparison/commercial_123.jpg" width="1400"></td></tr>
</table>
</details>
</div>
---
## ποΈ Model Architecture
<div align="center">
<img src="https://raw.githubusercontent.com/W2GenAI-Lab/LucidFlux/main/images/framework/framework.png" alt="LucidFlux Framework Overview" width="1200"/>
<br>
<em><strong>Caption-Free Universal Image Restoration with a Large-Scale Diffusion Transformer</strong></em>
</div>
Our unified framework consists of **four critical components in the training workflow**:
**π€ Scaling Up Real-world High-Quality Data for Universal Image Restoration**
**π¨ Two Parallel Light-weight Condition Module Branches for Low-Quality Image Conditioning**
**π― Timestep and Layer-Adaptive Condition Injection**
**π Semantic Priors from Siglip for Caption-Free Semantic Alignment**
## π Quick Start
### π§ Installation
```bash
# Clone the repository
git clone https://github.com/W2GenAI-Lab/LucidFlux.git
cd LucidFlux
# Create conda environment
conda create -n lucidflux python=3.9
conda activate lucidflux
# Install dependencies
pip install -r requirements.txt
```
### 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.
```bash
python -m tools.hf_login --token "$HF_TOKEN"
```
2) Download required weights to fixed paths and export env vars
```bash
# 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
source weights/env.sh
```
Run inference (uses fixed relative paths):
```bash
bash inference.sh
```
You can also obtain results of LucidFlux on RealSR and RealLQ250 from Hugging Face: [**LucidFlux**](https://huggingface.co/W2GenAI/LucidFlux).
## πͺͺ License
The provided code and pre-trained weights are licensed under the [FLUX.1 [dev]](LICENSE).
## π Acknowledgments
- This code is based on [FLUX](https://github.com/black-forest-labs/flux). Some code are brought from [DreamClear](https://github.com/shallowdream204/DreamClear), [x-flux](https://github.com/XLabs-AI/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**: `[email protected]`
- **Tian Ye**: `[email protected]`
## π§βπ€βπ§ WeChat Group
<details>
<summary>ηΉε»ε±εΌδΊη»΄η οΌWeChat Group QR CodeοΌ</summary>
<br>
<img src="https://github.com/user-attachments/assets/047faa4e-da63-415c-97a0-8dbe8045a839"
alt="WeChat Group QR"
width="320">
</details> |