πŸ“‹ Model Description


license: other license_name: flux-1-dev-non-commercial-license license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/LICENSE.md base_model:
  • black-forest-labs/FLUX.1-dev
pipeline_tag: text-to-image library_name: diffusers tags:
  • flux
  • text-to-image

!!! Experimental supported by gpustack/llama-box v0.0.84+ only !!!

Model creator: Freepik

Original model: flux.1-lite-8B-alpha

GGUF quantization: based on stable-diffusion.cpp ac54e that patched by llama-box.

QuantizationOpenAI CLIP ViT-L/14 QuantizationGoogle T5-xxl QuantizationVAE Quantization
FP16FP16FP16FP16
Q80FP16Q80FP16
(pure) Q80Q80Q8_0FP16
Q41FP16Q80FP16
Q40FP16Q80FP16
(pure) Q40Q40Q4_0FP16

!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 guidancescale of 3.5 and setting nsteps between 22 and 30.

import torch
from diffusers import FluxPipeline

basemodelid = "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( modelid, torchdtype=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"

guidancescale = 3.5 # Keep guidancescale at 3.5
n_steps = 28
seed = 11

with torch.inference_mode():
image = pipe(
prompt=prompt,
generator=torch.Generator(device="cpu").manual_seed(seed),
numinferencesteps=n_steps,
guidancescale=guidancescale,
height=1024,
width=1024,
).images[0]
image.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.
!ComfyUI workflow

The safetensors checkpoint is available here: flux.1-lite-8B-alpha.safetensors

HF spaces πŸ€—

You can also test the model on Flux.1 Lite HF space thanks to TheAwakenOne

Try it out at Freepik!

Our AI generator is now powered by Flux.1 Lite!

πŸ”₯ News πŸ”₯

Citation

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},
}

Attribution notice

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.

πŸ“‚ GGUF File List

πŸ“ Filename πŸ“¦ Size ⚑ Download
FLUX.1-lite-FP16.gguf
LFS FP16
24.83 GB Download
FLUX.1-lite-Q4_0.gguf
Recommended LFS Q4
9.87 GB Download
FLUX.1-lite-Q4_1.gguf
LFS Q4
10.34 GB Download
FLUX.1-lite-Q8_0.gguf
LFS Q8
13.64 GB Download
FLUX.1-lite-pure-Q4_0.gguf
LFS Q4
7.43 GB Download
FLUX.1-lite-pure-Q8_0.gguf
LFS Q8
13.54 GB Download