We are thrilled to announce the release of Flux.1 Lite, an 8B parameter transformer model distilled from the FLUX.1-dev model. This version uses 7 GB less RAM and runs 23% faster while maintaining the same precision (bfloat16) as the original model.
`🔥 UPDATE 🔥`: We have released a new version of Flux.1 Lite 8B. This version is trained with a new dataset and achieves better results than the previous alpha version. The main changes include:
- Distillation for a broader range of guidance values (2.0-5.0)
- Distillation for a broader range of number of steps (20-32)
- More diverse dataset with longer prompts
![Flux.1 Lite vs FLUX.1-dev](sample_images/models_comparison.png)
## Text-to-Image
Flux.1 Lite is ready to unleash your creativity! For the best results, we strongly **recommend using a `guidance_scale` between 2.0 and 5.0 and setting `n_steps` between 20 and 32**.
```python
import torch
from diffusers import FluxPipeline
torch_dtype = torch.bfloat16
device = "cuda"
# Load the pipe
model_id = "Freepik/flux.1-lite-8B"
pipe = FluxPipeline.from_pretrained(
model_id, torch_dtype=torch_dtype
).to(device)
# Inference
prompt = "A close-up image of a green alien with fluorescent skin in the middle of a dark purple forest"
Inspired by [Ostris](https://ostris.com/2024/09/07/skipping-flux-1-dev-blocks/) findings, we analyzed the mean squared error (MSE) between the input and output of each block to quantify their contribution to the final result, revealing significant variability.
![Flux.1 Lite generated image](sample_images/generated_img.png)
![MSE MMDIT](sample_images/mse_mmdit_img.png)
![MSE DIT](sample_images/mse_dit_img.png)
As Ostris pointed out, not all blocks contribute equally. While skipping just one of the early MMDiT or late DiT blocks can significantly impact model performance, skipping any single block in between does not have a significant impact over the final image quality.
![Skip one MMDIT block](sample_images/skip_one_MMDIT_block.png)
![Skip one DIT block](sample_images/skip_one_DIT_block.png)
## ComfyUI
We've also crafted a ComfyUI workflow to make using Flux.1 Lite even more seamless! Find it in `comfy/flux.1-lite_workflow.json`.