Instructions to use wavespeed/FLUX.1-dev-e4m3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use wavespeed/FLUX.1-dev-e4m3 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("wavespeed/FLUX.1-dev-e4m3", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
FLUX.1-dev-e4m3
FP8 (e4m3) dynamically-quantized FLUX.1-dev,
saved as a complete FluxPipeline.
What was changed
Every double and single transformer block of the FluxTransformer2DModel is
quantized to e4m3_e4m3_dynamic — float8_e4m3fn weights with dynamically
scaled float8_e4m3fn activations. The rest of the pipeline is unchanged: the
transformer's non-block tensors, the CLIP text encoder and the VAE stay in
fp16, and the T5 text encoder stays in bf16. The transformer shrinks from
~23.8 GB to ~12.0 GB.
This is the same recipe as
wavespeed/FLUX.1-dev-int8
with an fp8 rather than int8 numeric format. FP8 matmul needs Hopper (H100/H200)
or newer; on Ada and older the weights dequantize instead and you lose the speedup.
Quantization was done with WaveSpeed's xelerate.ao.quantize. Weights are
stored as pickled .bin shards, so loading requires use_safetensors=False.
Usage
import torch
from diffusers import FluxPipeline
pipe = FluxPipeline.from_pretrained(
"wavespeed/FLUX.1-dev-e4m3",
torch_dtype=torch.float16,
use_safetensors=False,
).to("cuda")
License
Derived from FLUX.1-dev, so the FLUX.1 [dev] Non-Commercial License applies to these weights and to anything generated with them. Not for commercial use.
- Downloads last month
- 17
Model tree for wavespeed/FLUX.1-dev-e4m3
Base model
black-forest-labs/FLUX.1-dev