Instructions to use mlx-community/flux-3-image-klein-pup-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/flux-3-image-klein-pup-8bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("mlx-community/flux-3-image-klein-pup-8bit") config = load_config("mlx-community/flux-3-image-klein-pup-8bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use mlx-community/flux-3-image-klein-pup-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/flux-3-image-klein-pup-8bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mlx-community/flux-3-image-klein-pup-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use mlx-community/flux-3-image-klein-pup-8bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/flux-3-image-klein-pup-8bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mlx-community/flux-3-image-klein-pup-8bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mlx-community/flux-3-image-klein-pup-8bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/flux-3-image-klein-pup-8bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "mlx-community/flux-3-image-klein-pup-8bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
mlx-community/flux-3-image-klein-pup-8bit
This is an MLX copy, 8-bit (affine, group 64), of black-forest-labs/flux-3-image-klein-pup (Apache-2.0), for Apple Silicon.
- Files: converted with mlx-vlm 0.7.8 (
mlx_vlm convert -q --q-bits 8 --q-group-size 64); tokenizer, chat template, processor configs andsystem_prompts.jsonare upstream's, byte-identical. - Other tiers: bf16, 4bit.
- Size: 9.8 GB.
The model is the prompt upsampler for FLUX 3 Image Klein. It's a Qwen3.5-9B vision-language fine-tune that expands a short request (plus up to 10 reference images, plus optional bounding boxes) into the full scene caption FLUX 3 Klein needs. A short prompt sent to the image model as typed gives generic output. This repo is Apache-2.0 like its upstream. The FLUX 3 Klein image model itself is under the FLUX Kommunity License (mlx-community/flux-3-image-klein-bf16).
Use
It loads with MLXVLM (mlx-swift-lm, qwen3_5) and with Python mlx-vlm. The upstream card is the reference for:
- the system prompts (
system_prompts.json:t2i,i2i,t2i_bbox,i2i_bbox); - the edit scaffold;
- the decoding: greedy, presence penalty 1.5 for text-to-image and 0 for edits,
enable_thinking=False, at most 3,584 new tokens.
Two details matter:
- The presence penalty counts generated tokens only, as vLLM does. mlx-lm's presence penalty also counts the prompt.
- References are prepared first: alpha over white, LANCZOS to 1 MP for one reference, 724ยฒ for two, 512ยฒ for 3โ10, sides multiples of 32, then a JPEG q92 round trip.
flux3-klein-swift's Flux3PromptUpsampler implements all of it:
import Flux3KleinUpsampler
let up = try await Flux3PromptUpsampler.load(directory: snapshotURL)
let caption = try await up.upsample("A man walking with his dog, afternoon sun")
Parity (the Swift/MLX port vs BFL's reference, flux3/pup.py)
| Check | Result |
|---|---|
| Prompt tokens vs the HF processor (t2i, t2i+boxes, 1-ref and 2-ref edits, edit+boxes) | exact, 737โ1,914 tokens |
Box planning / reconcile vs bbox.py |
13/13 cases exact |
| 1-ref edit caption on BFL's own reference pixels (bf16) | identical to BFL's caption, word for word |
| Text-to-image caption, man_dog (bf16) | 0.991 word similarity to BFL's |
Greedy decoding is chaotic near ties. BFL's own captions for the same request differ between their runs (0.25โ1.0 similarity), so exact match is not the bar.
Tiers (19 requests from BFL's examples)
The bar: every quoted string kept verbatim and every box table complete. Similarity to the bf16 caption is reported for information.
| Tier | Quoted text kept | Box tables | Similarity to bf16 | Memory (M5 Max) |
|---|---|---|---|---|
| bf16 | 20/20 | 2/2 | 1.00 | 18.8 GB resident, 20.2 GB peak |
| 8bit | 20/20 | 2/2 | 0.68 | 10.4 GB resident, 11.1 GB peak |
| 4bit | 20/20 | 2/2 | 0.45 | 6.0 GB resident, 6.8 GB peak |
Lower tiers paraphrase more, but the captions keep the same structure, subjects and quoted text. Each caption takes about 9โ15 s on an M5 Max.
License
Apache-2.0, as upstream. It is derived from Qwen/Qwen3.5-9B (Apache-2.0). This copy is not an official Black Forest Labs release.
- Downloads last month
- 345
8-bit
Model tree for mlx-community/flux-3-image-klein-pup-8bit
Base model
Qwen/Qwen3.5-9B-Base