How to use from the
Use from the
Diffusers library
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("deAPI-ai/flux-2-klein-4b-bf16", 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]

FLUX.2 Klein 4B BF16

A distilled 4B parameter image generation model optimized for speed, delivering state-of-the-art quality with end-to-end inference in under a second.

Author

Black Forest Labs

License

Apache License 2.0


Hosted by deAPI-ai for use with GamerHash AI

Downloads last month
70
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support