Instructions to use AwesomeEZ12/FLUX.2-klein-4B-fp8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use AwesomeEZ12/FLUX.2-klein-4B-fp8 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("AwesomeEZ12/FLUX.2-klein-4B-fp8", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
FLUX.2 [klein] 4B, float8 weights
This is a modified copy of black-forest-labs/FLUX.2-klein-4B by Black Forest Labs,
released under the Apache License 2.0 (see LICENSE.md).
What changed: the large linear layers of transformer/ and text_encoder/ were cast from
bfloat16 to float8 (e4m3fn) without scaling, and re-sharded. Layers matching
norm, embed, proj_out, x_embedder, context_embedder, time, lm_head stay in bfloat16, and so do the VAE, tokenizer, scheduler and configs. No
weights were trained or tuned. mcr_fp8.json records the exact settings.
Load the layers with float8 storage and bfloat16 compute (for example diffusers'
apply_layerwise_casting), as Minecraft Clip Radar's Thumbnail Lab does.
- Downloads last month
- 20
Model tree for AwesomeEZ12/FLUX.2-klein-4B-fp8
Base model
black-forest-labs/FLUX.2-klein-4B