1-Bit Bonsai Image 4B Image Generation for Local Devices
TL;DR Highlight
Binarizing FLUX.2 Klein 4B weights makes image generation run on an iPhone
Who Should Read
A mobile or app developer evaluating on-device image generation instead of a server API
Core Mechanics
- FLUX.2 Klein 4B compressed to 1 bit
- The diffusion transformer weights are {−1,+1} with an FP16 group scale, for 1.125 effective bits.
- The architecture is unchanged; only the weight representation changed.
- Ternary adds a zero state
- Weights are {−1,0,+1}, for 1.71 effective bits.
- It is bigger than 1-bit but improves visual quality and prompt fidelity.
- Transformer shrank up to 8.3x
- FP16 FLUX.2 Klein 4B is 7.75 GB, 1-bit is 0.93 GB, Ternary is 1.21 GB (6.4x).
- About 5% of precision-sensitive projection layers stay in FP16.
- Runtime memory dropped about 7x
- At 512x512, mean-active memory is 1.5 GB for 1-bit, 1.96 GB for Ternary, 11.74 GB for the original.
- At 1024x1024 it is 1.95 GB, 2.38 GB, and 14.39 GB.
- Runs on iPhone 17 Pro Max
- The original FLUX.2 Klein 4B does not fit in the device memory budget, while both Bonsai variants run on-device.
- A 512x512 image takes 9.4 s on iPhone 17 Pro Max and about 6 s on Mac M4 Pro.
- Ternary keeps 95% of quality
- Versus FLUX.2 Klein 4B across GenEval, HPSv3 and DPG-Bench, Ternary retains 95% and 1-bit 88%.
- Ternary scores GenEval 0.723, HPSv3 12.22, DPG-Bench 0.851 versus 0.819, 12.84, 0.853 for the original.
Community Reactions
- Community: the real bottleneck is generation time, not storage
- A commenter noted these models already run on 8-12 GB GPUs or similar-memory Macs, and that Bonsai is slightly slower than the original small FLUX.2.
- Community: the 'first on iPhone' claim was challenged
- One commenter said FLUX.2 klein 4B already runs on iPhone in Draw Things with 8-bit or 6-bit quantization.
- Another said SD XL (3.5B) runs on an iPhone 13 Pro.
- Community: quality reported as weaker in practice
- One tester said it is not as good as Flux.
- Another said the demo gets text for 'A sign that says xxxx' wrong almost every time.
- Community: text encoder size eats into the savings
- One commenter said a front-loaded 1.8 GB text encoder reduces the benefit.
- Another reported the WebGPU demo takes 7 seconds for 4 steps on an M4.
How to Apply
- Test your prompts in the WebGPU demo
- Today, run 10 real prompts from your service in the Hugging Face Bonsai Image WebGPU demo.
- Compare text-heavy images separately from ordinary scenes.
- Measure speed with Bonsai Studio
- Time a 512x512 generation on your target device.
- Compare to the reported 9.4 s on iPhone 17 Pro Max to judge if it fits your wait budget.
- Pick one server feature to move on-device
- Choose a feature with frequent regeneration and privacy-sensitive prompts.
- Choose Ternary for quality and 1-bit for memory.
- Check your memory budget with the numbers
- Compare your app's memory limit to Bonsai's mean-active memory (1.5-2.38 GB).
- Also check the deployment payload (3.42 GB and 3.88 GB) including the text encoder.
Terminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls