
FLUX.2 Small Decoder 是一个蒸馏版 VAE 解码器,可作为标准 FLUX.2 解码器的即插即用替代品。它能实现更快的解码速度和更低的显存占用,同时质量损失微乎其微甚至为零。编码器保持不变。
[96, 192, 384, 384] 对比 [128, 256, 512, 512])。兼容所有开源 FLUX.2 模型:
| 完整解码器 | 小型解码器 |
|---|---|
![]() | ![]() |
pip install git+https://github.com/huggingface/diffusers.gitimport torch
from diffusers import Flux2KleinPipeline, AutoencoderKLFlux2
device = "cuda"
dtype = torch.bfloat16
vae = AutoencoderKLFlux2.from_pretrained("black-forest-labs/FLUX.2-small-decoder", torch_dtype=dtype)
pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", vae=vae, torch_dtype=dtype)
pipe.enable_model_cpu_offload()
prompt = "A black cat holding a sign that says 'hello world' in typewriter font"
image = pipe(
prompt=prompt,
height=1024,
width=1024,
guidance_scale=1.0,
num_inference_steps=4,
generator=torch.Generator(device=device).manual_seed(0)
).images[0]
image.save("flux-klein-small-decoder.png")本模型及其衍生产品不得在许可范围外使用,包括用于非法、欺诈、诽谤、滥用或其他违反规定的目的,详见我们的使用政策。
Black Forest Labs 致力于负责任的模型开发与部署。在发布 FLUX.2 [klein] 9B-KV 之前,我们评估并缓解了多项风险,包括儿童性虐待材料(CSAM)和非自愿私密图像(NCII)。有关我们的缓解措施、评估流程、内容来源特征及政策的详细信息,请参阅我们的文章:Capable, Open, and Safe: Combating AI Misuse。
如报告安全问题,请联系 safety@blackforestlabs.ai。
本模型根据 https://www.apache.org/licenses/LICENSE-2.0 许可协议授权。
本项目可能包含项目、产品或服务的商标或徽标。在本项目的修改版本中使用 Black Forest Labs 和 FLUX 的商标或徽标,不得引起混淆,也不得暗示赞助或背书。任何第三方商标、知识产权或徽标的使用均受第三方政策的约束。