🚀 Flux.1 Lite
Flux.1 Lite是一款從FLUX.1 - dev模型中提煉出來的80億參數的變換器模型。它比原模型少佔用7GB內存,運行速度快23%,同時保持了與原模型相同的精度(bfloat16),能有效釋放你的創造力!
🚀 快速開始
文本轉圖像
Flux.1 Lite已準備好釋放你的創造力!為獲得最佳效果,我們強烈建議使用2.0至5.0之間的guidance_scale
,並將n_steps
設置在20至32之間。
import torch
from diffusers import FluxPipeline
torch_dtype = torch.bfloat16
device = "cuda"
model_id = "Freepik/flux.1-lite-8B"
pipe = FluxPipeline.from_pretrained(
model_id, torch_dtype=torch_dtype
).to(device)
prompt = "A close-up image of a green alien with fluorescent skin in the middle of a dark purple forest"
guidance_scale = 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")
✨ 主要特性
- 性能優化:與原模型相比,使用的RAM減少7GB,運行速度提高23%,同時保持相同的精度(bfloat16)。
- 版本更新:新版本使用新數據集進行訓練,在蒸餾時涵蓋了更廣泛的指導值範圍(2.0 - 5.0)和步數範圍(20 - 32),數據集更多樣且提示詞更長,比之前的alpha版本取得了更好的效果。
📚 詳細文檔
模型信息
屬性 |
詳情 |
基礎模型 |
black - forest - labs/FLUX.1 - dev |
任務類型 |
文本轉圖像 |
庫名稱 |
diffusers |
標籤 |
flux、文本轉圖像 |
動機
受Ostris研究結果的啟發,我們分析了每個塊的輸入和輸出之間的均方誤差(MSE),以量化它們對最終結果的貢獻,結果顯示出顯著的差異性。並非所有塊的貢獻都是相等的,跳過早期的MMDiT或晚期的DiT塊中的任何一個都會顯著影響模型性能,而跳過中間的任何單個塊對最終圖像質量沒有顯著影響。
ComfyUI工作流
我們還精心製作了一個ComfyUI工作流,讓使用Flux.1 Lite更加無縫!可在comfy/flux.1 - lite_workflow.json
中找到它。
試用地址
我們的AI生成器現在由Flux.1 Lite提供支持!
最新消息
- 2024年12月30日:Flux.1 Lite 8B新訓練模型在[HuggingFace倉庫](https://huggingface.co/Freepik/flux.1 - lite - 8B)公開可用。
- 2024年10月23日:Alpha 8B檢查點在[HuggingFace倉庫](https://huggingface.co/Freepik/flux.1 - lite - 8B - alpha)公開可用。
引用信息
如果您覺得我們的工作有幫助,請引用它!
@article{flux1-lite,
title={Flux.1 Lite: Distilling Flux1.dev for Efficient Text-to-Image Generation},
author={Daniel Verdú, Javier Martín},
email={dverdu@freepik.com, javier.martin@freepik.com},
year={2024},
}
📄 許可證
本項目採用[flux - 1 - dev - non - commercial - license](https://huggingface.co/black - forest - labs/FLUX.1 - dev/resolve/main/LICENSE.md)許可證。
