Views
No views yet

🔥 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:
guidance_scale between 2.0 and 5.0 and setting n_steps between 20 and 32.1import torch
2from diffusers import FluxPipeline
3
4torch_dtype = torch.bfloat16
5device = "cuda"
6
7# Load the pipe
8model_id = "Freepik/flux.1-lite-8B"
9pipe = FluxPipeline.from_pretrained(
10 model_id, torch_dtype=torch_dtype
11).to(device)
12
13# Inference
14prompt = "A close-up image of a green alien with fluorescent skin in the middle of a dark purple forest"
15
16guidance_scale = 3.5
17n_steps = 28
18seed = 11
19
20with torch.inference_mode():
21 image = pipe(
22 prompt=prompt,
23 generator=torch.Generator(device="cpu").manual_seed(seed),
24 num_inference_steps=n_steps,
25 guidance_scale=guidance_scale,
26 height=1024,
27 width=1024,
28 ).images[0]
29image.save("output.png")




comfy/flux.1-lite_workflow.json.

1@article{flux1-lite,
2 title={Flux.1 Lite: Distilling Flux1.dev for Efficient Text-to-Image Generation},
3 author={Daniel Verdú, Javier Martín},
4 email={dverdu@freepik.com, javier.martin@freepik.com},
5 year={2024},
6}