Model creator: Freepik Original model: flux.1-lite-8B-alpha GGUF quantization: based on stable-diffusion.cpp ac54e that patched by llama-box.
Quantization
OpenAI CLIP ViT-L/14 Quantization
Google T5-xxl Quantization
VAE Quantization
FP16
FP16
FP16
FP16
Q8_0
FP16
Q8_0
FP16
(pure) Q8_0
Q8_0
Q8_0
FP16
Q4_1
FP16
Q8_0
FP16
Q4_0
FP16
Q8_0
FP16
(pure) Q4_0
Q4_0
Q4_0
FP16
Flux.1 Lite
Flux.1 Lite
We are thrilled to announce the alpha 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.
Flux.1 Lite vs FLUX.1-dev
Text-to-Image
Flux.1 Lite is ready to unleash your creativity! For the best results, we strongly recommend using a guidance_scale of 3.5 and setting n_steps between 22 and 30.
python
1import torch
2from diffusers import FluxPipeline
34base_model_id ="Freepik/flux.1-lite-8B-alpha"5torch_dtype = torch.bfloat16
6device ="cuda"78# Load the pipe9model_id ="Freepik/flux.1-lite-8B-alpha"10pipe = FluxPipeline.from_pretrained(11 model_id, torch_dtype=torch_dtype
12).to(device)1314# Inference15prompt ="A close-up image of a green alien with fluorescent skin in the middle of a dark purple forest"1617guidance_scale =3.5# Keep guidance_scale at 3.518n_steps =2819seed =112021with torch.inference_mode():22 image = pipe(23 prompt=prompt,24 generator=torch.Generator(device="cpu").manual_seed(seed),25 num_inference_steps=n_steps,26 guidance_scale=guidance_scale,27 height=1024,28 width=1024,29).images[0]30image.save("output.png")
Motivation
Inspired by Ostris 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
MSE MMDIT
MSE DIT
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
Skip one DIT block
Future work
Stay tuned! Our goal is to distill FLUX.1-dev further until it can run smoothly on 24 GB consumer-grade GPU cards, maintaining its original precision (bfloat16), and running even faster, making high-quality AI models accessible to everyone.
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.