---
title: Qwen-Image-2.1-MNN-int8
canonical_url: "https://www.modelscope.cn/models/yunfeng/Qwen-Image-2.1-MNN-int8"
md_url: "https://www.modelscope.cn/models/yunfeng/Qwen-Image-2.1-MNN-int8.md"
repository: yunfeng/Qwen-Image-2.1-MNN-int8
last_updated: 2026-09-23
license: other
base_model:
  - Qwen/Qwen-Image-2.1
base_model_relation: finetune
library_name:
  - lora
  - pytorch
frameworks:
  - pytorch
downloads: 0
stars: 0
tags:
  - mnn
  - text-to-image
  - qwen-image
  - on-device
  - int8
---

# Qwen-Image-2.1-MNN-int8

> Qwen-Image-2.1-MNN-int8 - yunfeng 在 ModelScope 开源的模型。Qwen-Image-2.1-MNN-int8

yunfeng/Qwen-Image-2.1-MNN-int8 是 ModelScope 魔搭社区上的机器学习模型，采用 other 许可，基于 Qwen/Qwen-Image-2.1 构建。

- **Repository**: yunfeng/Qwen-Image-2.1-MNN-int8
- **License**: other
- **Base model**: Qwen/Qwen-Image-2.1
- **Tags**: mnn, text-to-image, qwen-image, on-device, int8
- **Downloads**: 0
- **Stars**: 0
- **Last updated**: 2026-09-23

Source: https://www.modelscope.cn/models/yunfeng/Qwen-Image-2.1-MNN-int8

---

# Qwen-Image-2.1-MNN-int8

**Qwen-Image-2.1** converted to [MNN](https://github.com/alibaba/MNN) with weight-only int8
quantization — 21.4 GB instead of the fp16 set's 30.7 GB, for on-device text-to-image inference
with no torch, no diffusers and no 33 GB checkpoint. The text encoder and the DiT are int8
(block 32, HQQ), the VAE stays fp32.

Run it with the `qwen-image-mnn` CLI (downloads into `~/.cache/qwen-image-mnn/int8` on first
use, then renders offline):

```bash
uvx qwen-image-mnn "a red panda riding a bicycle" --quant int8 --steps 40 --out panda.png
```

## Files

| file | size | precision |
| --- | --- | --- |
| `dit.mnn` + `dit.mnn.weight` | 8.90 GB | int8 |
| `text_encoder.mnn` + `text_encoder.mnn.weight` | 11.18 GB | int8 |
| `vae_decoder.mnn` | 1.0 GB | fp32 |
| `vae_encoder.mnn` | 0.31 GB | fp32 |
| `tokenizer.json`, `vae_config.json` | 11 MB | — |
| `manifest.json` | — | per-file sha256 |

Quantized with `mnnconvert --weightQuantBits 8 --weightQuantBlock 32 --hqq` from the same fp32
ONNX graphs the fp16 set was converted from. The text encoder shrinks less than the DiT — 26% of
its bytes against 37% — so part of it stays in fp16.

## Verification

Measured against the fp16 set and against the released pipeline, on the same inputs:

| check | int8 | fp16 (for scale) |
| --- | --- | --- |
| DiT, one forward at T=1120, max rel | 2.5e-2 | — (baseline) |
| text encoder, mean abs drift / max abs value | 4.8e-4 | 8.5e-5 |
| pipeline, 8 steps @512 px, latent drift step 1 → step 8 | 1.4e-3 → 2.4e-2 | 4.9e-3 → 2.9e-2 |
| pipeline, image PSNR vs the reference render | 52.0 dB | 43.6 dB |

Both quantized and fp16 numbers sit inside the model's own dtype noise: the released model
compared against *itself* (fp16 vs bf16, same seed and latents) drifts up to 2.0e-1, so a 2.4e-2
latent drift at int8 is not a distinguishable difference — the images are visually identical.

## Speed

Weight-only quantization does not make the stock CPU backend faster by itself: the weights are
dequantized as they are paged in, so the saving is download size and disk, not step time. In the
single-forward probe the int8 DiT was 2.6x faster than fp16 (42 s against 108 s at T=1120, both
measured on the same loaded machine) because the DiT is memory-bandwidth bound — treat that as a
hint, not a benchmark; per-step timings are in the package README.

## Backend support

- **CPU, `precision=high`: the verified path.**
- Metal: broken in the current MNN release (the tensor-API probe fails to compile on macOS 26 and
  the fallback kernels return garbage). MNN master fixes the probe — a local master build computes
  all three graphs correctly on Metal — but only the VAE gets faster (3.1x); the DiT is ~4x
  slower than CPU (95.7 s against 24.1 s at T=1120), so CPU stays the fastest full path. The pip
  wheel cannot load a locally built `libMNN.dylib`, so this needs an upstream release anyway.

## License

A format conversion of [Qwen-Image-2.1](https://huggingface.co/Qwen/Qwen-Image-2.1) and carries
its license: **Qwen Research License** — research use.
