Instructions to use ar9av/FLUX.2-klein-4B-mflux-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use ar9av/FLUX.2-klein-4B-mflux-4bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir FLUX.2-klein-4B-mflux-4bit ar9av/FLUX.2-klein-4B-mflux-4bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
FLUX.2-klein-4B โ mflux 4-bit (Apple Silicon)
4-bit quantized version of black-forest-labs/FLUX.2-klein-4B, saved with mflux for fast inference on Apple Silicon Macs.
~4 GB on disk (vs 16 GB for the original BF16 weights).9 seconds per image** at 512ร512, 4 steps on M-series chips.
**
Sample output
Prompt: "a red apple on a white table", seed 42, 512ร512, 4 steps
Requirements
pip install mflux
Requires macOS with Apple Silicon (M1/M2/M3/M4). Tested with mflux 0.18.0.
Usage
Python
from mflux.models.flux2.variants.txt2img.flux2_klein import Flux2Klein
from mflux.models.common.config.model_config import ModelConfig
flux = Flux2Klein(
model_config=ModelConfig.flux2_klein_4b(),
model_path="ar9av/FLUX.2-klein-4B-mflux-4bit",
)
image = flux.generate_image(
seed=42,
prompt="a photo of an astronaut riding a horse on mars",
num_inference_steps=4,
width=1024,
height=1024,
guidance=1.0,
)
image.image.save("output.png")
CLI
mflux-generate-flux2 \
--model flux2-klein-4b \
--model-path ar9av/FLUX.2-klein-4B-mflux-4bit \
--prompt "a photo of an astronaut riding a horse on mars" \
--steps 4 \
--output output.png
With mlx-local-server (OpenAI-compatible API)
# Load the model
curl -X POST http://localhost:8002/v1/models/load \
-H "Content-Type: application/json" \
-d '{"model": "flux2-klein", "model_path": "ar9av/FLUX.2-klein-4B-mflux-4bit"}'
# Generate
curl -X POST http://localhost:8002/v1/images/generations \
-H "Content-Type: application/json" \
-d '{"prompt": "a red apple", "size": "512x512"}'
Model details
| Property | Value |
|---|---|
| Base model | black-forest-labs/FLUX.2-klein-4B |
| Quantization | 4-bit (mflux format) |
| Saved with | mflux 0.18.0 |
| Architecture | Flux2Klein (Qwen3 text encoder, no T5) |
| Parameters | ~4B |
| Guidance | 1.0 (distilled, CFG-free) |
Notes
- This model does not support
negative_prompt(distilled model, guidance=1.0). - For img2img, pass
image_pathandimage_strengthtogenerate_image. - License follows the original FLUX.1-dev non-commercial license.
Hardware compatibility
Log In to add your hardware
Quantized
Model tree for ar9av/FLUX.2-klein-4B-mflux-4bit
Base model
black-forest-labs/FLUX.2-klein-4B