kny/FLUX.2-klein-4B-onnx-web

AI model by kny

Open original source ↗

Older snapshot: check the original source for current information.

From the publisher

Model card & documentation

Source preview

Read the publisher’s intended use, setup instructions, evaluations and limitations. The original model card is the source of truth.

This is an ONNX conversion of black-forest-labs/FLUX.2-klein-4B, made for in-browser inference with onnxruntime-web on WebGPU. FLUX.2 [klein] 4B is by Black Forest Labs and is released under Apache-2.0. Its text encoder is a Qwen3-4B derivative by Alibaba Cloud / Qwen, also released under Apache-2.0. Kim Nyberg converted the model to ONNX. See NOTICE. Every file is under 2 GB (the largest is 1.80 GB). All graphs use opset 18 (ai.onnx) plus com.microsoft.MatMulNBits. tokenizer/ (Qwen2 tokenizer + chat template) and scheduler/schedulerconfig.json are copied unchanged from the original repo. promptembeds is concat(hiddenstates[9], hiddenstates[18], hiddenstates[27]) along the last dimension, exactly as Flux2KleinPipeline.getqwen3promptembeds computes it. Only the first 28 decoder layers are kept, and layer 27 is pruned as dead code, so the graph runs 27 layers. To match the reference, build the prompt with the chat template ([{"role":"user","content": prompt}], addgenerationprompt=true, enablethinking=false) and right-pad to 512 tokens (maxsequencelength = 512). The token dimensions are…

kny/FLUX.2-klein-4B-onnx-web on Hugging Face A short preview, not the full document.

Read the full model card ↗ · Preview checked 2026-11-01T18:03:29.798Z

Inside the original model card — Document outline
  1. FLUX.2 [klein] 4B for ONNX Runtime Web (WebGPU)
  2. I/O
  3. textencoderq4.onnx
  4. transformerq4.onnx (one denoising step, no CFG; klein is guidance-distilled)
  5. vaedecoderfp16.onnx
  6. Sampling loop (what the JS side must do)
  7. Loading in onnxruntime-web
  8. WebGPU op notes
  9. Validation (CPU, onnxruntime 1.31)
  10. Licence

Headings are captured from the source. Links open the publisher’s document, not a locally hosted copy.

Documentation belongs to its respective authors. A listing is not a grant of reuse or training rights. Confirm the document’s own terms at the source.

Model overview

kny/FLUX.2-klein-4B-onnx-web is a task-unspecified model repository published by kny on Hugging Face. A library was not reported.

This page summarizes Hub metadata. For intended use, training data, evaluation results and limitations, consult the original model card.

Model facts

Task
Not reported
Library
Not reported
Recent downloads (30 days)
0
Cumulative likes
0
Hugging Face trending score
0
Reported safetensors parameters
Not reported
Architecture
Not reported
License
Not reported — check the model card
Access
Not gated by Hugging Face
Created
2026-10-15T06:25:42.000Z
Last modified
2026-10-15T06:25:42.000Z

Compatibility and lineage

Language coverage was not reported.

Base-model lineage was not included.

Parameter count is not a RAM/VRAM requirement. Check precision, quantization, context length and runtime compatibility in the model card; no hardware or API-cost claim is inferred here.

Use and evaluate

Check license terms and access requirements first. Review the model card’s documented loading instructions, evaluations and safety limitations. Benchmark scores are not imported by this directory, and popularity is not an accuracy ranking.

No model weights are downloaded or executed by AltAPIs. Never enable remote model code without reviewing it.

Model card and usage instructions

Model files and configuration

Community discussion

Source and freshness

Source: Hugging Face Hub. Metadata observed 2026-10-15T06:42:18.893Z. Daily imports are snapshots, not real-time monitoring.

Popularity and source listings do not establish security, suitability, licensing rights or benchmark performance.

Open original source

Related models