---
title: Qwen-Image-2.1-MNN-int4
canonical_url: "https://www.modelscope.cn/models/yunfeng/Qwen-Image-2.1-MNN-int4"
md_url: "https://www.modelscope.cn/models/yunfeng/Qwen-Image-2.1-MNN-int4.md"
repository: yunfeng/Qwen-Image-2.1-MNN-int4
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
  - int4
---

# Qwen-Image-2.1-MNN-int4

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

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

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

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

---

# Qwen-Image-2.1-MNN-int4

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

Run it with the `qwen-image-mnn` CLI:

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

## Files

| file | size | precision |
| --- | --- | --- |
| `dit.mnn` + `dit.mnn.weight` | 5.34 GB | int4 |
| `text_encoder.mnn` + `text_encoder.mnn.weight` | 7.71 GB | int4 |
| `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 |

## Verification

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

The int4 end-to-end drift (4.4e-1) is twice the released model's own fp16-vs-bf16 noise (2.0e-1),
so this is the first variant whose difference is measurable rather than theoretical. Isolating the
two graphs (`int8` text encoder + `int4` DiT, and `int4` text encoder + fp16 DiT) shows both
contribute, with the DiT the larger share. Single-object prompts still come out clean; expect
visible differences on detailed or text-heavy prompts.

Prefer **int8** unless the ~7 GB saved is decisive: it lands inside the model's own noise at
two-thirds of the fp16 download.

## Speed

As with int8, the saving is disk and download, not step time: the stock CPU backend dequantizes
weights as it pages them in. Measured on the same machine, one DiT forward at T=1120 took 38 s
(int4) against 108 s (fp16) in the single-forward probe — the graph is bandwidth bound — but
per-step timings end to end are in the package README.

## Backend support

- **CPU, `precision=high`: the verified path.**
- Metal: broken in the current MNN release; fixed in master, see the fp16 model card.

## 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.
