FLUX 3 Image Klein, 4-bit and 8-bit export for SpawnDev.ILGPU.ML
This is a modified (quantised) copy of black-forest-labs/flux-3-image-klein. It is not an official Black Forest Labs release and BFL has not endorsed or validated it.
It is licensed to you by Black Forest Labs under the FLUX Kommunity License: non-commercial use, or use of outputs as a Qualifying User. Read LICENSE.md and NOTICE before using it.
The weights are repacked so the model fits in a browser tab and runs on the SpawnDev.ILGPU.ML engine (C# kernels compiled to WebGPU, CUDA and OpenCL; no PyTorch, no ONNX Runtime). Large matrices are quantised to 4-bit (or, in the q8 files, 8-bit) blocks; nothing else about the model is changed. All credit for the model goes to Black Forest Labs.
| file | what | size |
|---|---|---|
text_encoder_q4.safetensors |
the text tower of Qwen3-VL-4B-Instruct, first 32 of 36 layers (the model reads hidden states 4, 8, ... 32) + embeddings | 2.26 GB |
transformer_q4.safetensors |
the 5.6B flow-map transformer | 3.47 GB |
text_encoder_q8.safetensors, transformer_q8.safetensors |
the same stages in 8-bit blocks (near lossless; for desktop GPUs) | 4.07 GB + 6.24 GB |
vae_decoder.onnx |
the autoencoder's decoder (post_quant_conv + decoder), fp32, dynamic spatial size | 199 MB |
vae_encoder.onnx |
the autoencoder's encoder (encoder + quant_conv, mean), for reference images | 138 MB |
vae_norm.json |
the 128-channel batch-norm statistics applied to the packed latents | |
tokenizer.json |
the Qwen tokenizer |
Quantisation format: every weight matrix [N, K] with K % 32 == 0 and at least a million elements is cut along K into blocks of 32 and stored as int32 words [N, K/32*5] (q4) or [N, K/32*9] (q8):
word 0 = fp16 scale d (low half) and fp16 offset m (high half), then 4 words of 8 nibbles (q4) or 8 words of 4 bytes (q8); value = d * q + m. Norm weights and small tensors stay bf16.
tools/unirig-harness/reference/flux3/ in the engine's repo has the scripts that wrote these files (quantize_flux3.py, quantize_flux3_text.py, export_flux3_vae.py).
Use
var pipe = await Flux3Pipeline.CreateAsync(accelerator, modelSource, "LostBeard/flux-3-image-klein-q4-ILGPU");
var image = await pipe.RunAsync(new Flux3Request { Caption = fullSceneCaption, Seed = 1, Width = 1024, Height = 1024 });
FLUX 3 Image Klein is trained on full scene captions: a short prompt gives generic pictures. Write the caption (or have an LLM expand your prompt with BFL's system prompts) before you draw. Text to image, 16 steps; checked against the reference implementation (bf16, same prompt and start noise, 512 px): the q8 files give the same picture at 31.9 dB PSNR, the q4 files the same scene with small differences in detail at 23.2 dB (about 8% relative error per 4-bit matrix).
Live demo: https://lostbeard.github.io/SpawnDev.ILGPU.ML/generate
License
FLUX Kommunity License v1.0, Black Forest Labs Inc. (LICENSE.md). The text encoder is derived from Qwen3-VL-4B-Instruct (Apache-2.0). The engine's code is MIT.
Model tree for LostBeard/flux-3-image-klein-q4-ILGPU
Base model
black-forest-labs/flux-3-image-klein