Instructions to use black-forest-labs/FLUX.2-klein-9b-fp8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use black-forest-labs/FLUX.2-klein-9b-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("black-forest-labs/FLUX.2-klein-9b-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] - Diffusion Single File
How to use black-forest-labs/FLUX.2-klein-9b-fp8 with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
4steps gives many 3 arms or other horrors images
This fp8 version + default Comfyui workflow gives 3 arms or other horrors images many time.
Giving 8steps seems to help...
as does 40 step, 33 (or 60) GB main flux2 model. It seems just quite bad at anatomy.
i tried even the official flux.2 pro version on replicated and it still made a mess quite often.
i recently hhad more luck using the flux2-dev_falai_turbo_merged_Q8_0.gguf version. It needs only 8 steps and i had a LOT less anatomy issues. Maybe it's the fp8 versions? Taking a slight performance hit with a gguf version of the fp16 version instead of fp8 maybe worth a try. model size fp8 vs q6 or q8, is usually in the same ballpark.