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
| base_model: black-forest-labs/FLUX.1-dev | |
| library_name: diffusers | |
| license: other | |
| license_name: flux-1-dev-non-commercial-license | |
| license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md | |
| pipeline_tag: text-to-image | |
| tags: | |
| - flux | |
| - text-to-image | |
| - quantized | |
| - fp8 | |
| - e4m3 | |
| - diffusers | |
| base_model_relation: quantized | |
| # FLUX.1-dev-e4m3 | |
| FP8 (e4m3) dynamically-quantized [FLUX.1-dev](https://huggingface.co/black-forest-labs/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`](https://huggingface.co/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 | |
| ```python | |
| 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](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) | |
| applies to these weights and to anything generated with them. Not for | |
| commercial use. | |