Downloads · 30 days
20
15% of all-time downloads
models123/flux.1-lite-8B-alpha
flux.1-lite-8B-alpha is a text-to-image model from models123. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as other.
Downloads · 30 days
20
15% of all-time downloads
All-time downloads
136
Public
Parameters
8.2B
42.7 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors42.6 GB · 100%
From the Hugging Face model README

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 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.
import torch
from diffusers import FluxPipeline
base_model_id = "Freepik/flux.1-lite-8B-alpha"
torch_dtype = torch.bfloat16
device = "cuda"
# Load the pipe
model_id = "Freepik/flux.1-lite-8B-alpha"
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"
guidance_scale = 3.5 # Keep guidance_scale at 3.5
n_steps = 28
seed = 11
with torch.inference_mode():
image = pipe(
prompt=prompt,
generator=torch.Generator(device="cpu").manual_seed(seed),
num_inference_steps=n_steps,
guidance_scale=guidance_scale,
height=1024,
width=1024,
).images[0]
image.save("output.png")
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.

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.

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.
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.

The safetensors checkpoint is available here: flux.1-lite-8B-alpha.safetensors
You can also test the model on Flux.1 Lite HF space thanks to TheAwakenOne
Our AI generator is now powered by Flux.1 Lite!
If you find our work helpful, please cite it!
@article{flux1-lite,
title={Flux.1 Lite: Distilling Flux1.dev for Efficient Text-to-Image Generation},
author={Daniel Verdú, Javier Martín},
email={[email protected], [email protected]},
year={2024},
}
The FLUX.1 [dev] Model is licensed by Black Forest Labs. Inc. under the FLUX.1 [dev] Non-Commercial License. Copyright Black Forest Labs. Inc.
Our model weights are released under the FLUX.1 [dev] Non-Commercial License.