Skip to main content
Bonsai Image 4B is a family of compact text-to-image models designed to run locally on phones, laptops, and NVIDIA GPUs. It is based on FLUX.2 Klein 4B. The diffusion transformer is available with either 1-bit binary or ternary weights. A small number of precision-sensitive layers remain at higher precision, while the text encoder and VAE are compressed separately as part of the complete deployment pipeline.

Specifications

Variants

The Ternary model is the recommended default. It preserves more of the original model’s visual quality while reducing the diffusion transformer to 1.21 GB. The 1-bit model brings the diffusion transformer below 1 GB and is optimized for devices where memory capacity and bandwidth are the primary constraints.

Artifacts

All model repositories are available in the Bonsai Image collection on Hugging Face. The MLX repositories are intended for Apple Silicon. The Gemlite repositories use low-bit CUDA kernels for NVIDIA GPUs.

How to run it

Clone the Bonsai Image demo repository:
Install the required dependencies and download the default ternary model:
The setup script detects your platform and selects the appropriate runtime:
  • MLX on Apple Silicon - Gemlite on Linux with an NVIDIA GPU
To install the smaller 1-bit model instead:

Generate an image

Run a single generation from the command line:
You can also configure the image size, seed, and output path:

Launch the local studio

Start the generation API and browser interface:
This launches: Send a generation request from another terminal:

Performance

For a 512 × 512 image, Bonsai Image 4B generates in approximately: On an M4 Pro, Bonsai Image 4B is up to 5.6× faster than the full-precision MFLUX pipeline. Mean active memory during 512 × 512 generation is approximately:

Run on iPhone

Bonsai Image 4B is also available through Bonsai Studio for iPhone. The app runs the ternary model directly on the device. Prompts and generated images remain local, and image generation does not require an internet connection. For the best experience, use an iPhone 15 Pro or newer with at least 8 GB of unified memory.