PeerPixel · FLUX.2 Klein for WebNN
FLUX.2 Klein (4B) packaged to run inside a browser through WebNN and onnxruntime-web. These are the exact files PeerPixel fetches at runtime; nothing here needs a server or a Python environment.
What is in here
| Path | Contents |
|---|---|
models/flux2-klein-4b-webnn/text_encoder/ |
Qwen3 text encoder — sharded embeddings, per-layer weights, tokenizer |
models/flux2-klein-4b-webnn/transformer/ |
The diffusion transformer, int4/f16 quantised, sharded |
models/flux-klein-webnn-io/ |
Conditioning, join, image-tail and output graphs plus their projection weights |
models/flux2-vae-webnn-decoder/ |
Static 512×512 VAE decoder and its external weight files |
ort/ |
onnxruntime-web wasm binaries, kept alongside the weights because they are too big for a Cloudflare Worker asset |
Every directory is driven by its own manifest.json. Fetch the manifest first
and follow it; do not assume filenames.
Using it
window.PEERPIXEL_MODEL_SOURCES = ["https://huggingface.co/Jplayz/peerpixel-flux2-klein/resolve/main"];
window.PEERPIXEL_ORT_BASE = "https://huggingface.co/Jplayz/peerpixel-flux2-klein/resolve/main/ort/";
The client caches every file in Cache Storage, so a returning visitor downloads nothing. The full set is about 14 GB.
Requirements
A Chromium-based browser with WebNN available, a GPU or NPU the runtime can
reach, and roughly 14 GB of free disk. The page must be cross-origin isolated
(COOP: same-origin, COEP: credentialless) because onnxruntime-web uses
threaded WebAssembly.
Provenance and licence
Converted from Comfy-Org/flux2-klein
(FLUX.2 Klein 4B, Apache-2.0) with the Qwen3 4B text encoder (Apache-2.0). The
conversion tooling lives in the PeerPixel repo
under model-export/. Quantisation, sharding and graph splitting were done to
fit browser memory limits and to keep individual files small enough to cache and
to resume mid-download.
These files are a repackaging, not a retraining. Apache-2.0 carries through from the upstream weights.