Downloads · 30 days
365
39% of all-time downloads
biali/bonsai-image-ternary-4B-FLUX2-klein-GGUF
bonsai-image-ternary-4B-FLUX2-klein-GGUF is a text-to-image model from biali. Use it when you need an image from a text prompt. It is set up for gguf. The card lists the license as apache-2.0.
A GGUF conversion of PrismML's Bonsai Image ternary diffusion transformer (prism-ml/bonsai-image-ternary-4B-unpacked), quantized to Q2K so it runs on-device with stable-diffusion.cpp (and the llmedge Android library).
Downloads · 30 days
365
39% of all-time downloads
All-time downloads
941
Public
Repo size
1.4 GB
Likes
2
Public
Click a slice to open those files.
.gguf1.4 GB · 100%
From the Hugging Face model README
A GGUF conversion of PrismML's Bonsai Image ternary diffusion transformer
(prism-ml/bonsai-image-ternary-4B-unpacked),
quantized to Q2_K so it runs on-device with
stable-diffusion.cpp (and the
llmedge Android library).
Bonsai Image is FLUX.2 Klein 4B fine-tuned with quantization-aware training (QAT) to ternary weights. Its official releases ship only in MLX (Apple) and GemLite (CUDA) packings, neither of which loads on Android. This is the diffusion transformer only, in the BFL tensor layout sdcpp expects, quantized to Q2_K (~1.3 GB).
ggml's literal ternary types (tq1_0/tq2_0) load and run, but their per-256-weight scale is too
coarse for Bonsai's per-128 trained scales and produce degraded output. Q2_K's finer per-16
sub-block scales preserve the QAT quality at a comparable size.
Also needs a Qwen3-4B text encoder GGUF and the FLUX.2 VAE:
sd --diffusion-model bonsai-flux2-klein-ternary-q2_k.gguf \
--vae flux2-vae.safetensors \
--llm qwen_3_4b.gguf \
-p "a red fox in snow, detailed, 8k" \
--cfg-scale 1.0 --steps 4 --offload-to-cpu --diffusion-fa --vae-tiling
scripts/convert_bonsai_flux2_to_bfl.py (in llmedge): Bonsai diffusers transformer → BFL naming
(renames + fuses the double-block to_q/k/v into *_attn.qkv).sd -M convert -m bonsai-flux2-bfl.safetensors --type q2_K -o <this file>.Apache-2.0, inherited from the base model (PrismML / Deepgrove). All credit for the model and its QAT training goes to PrismML; this repo only redistributes a GGUF quantization.