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

# Qwen-Image-2.1-MNN-fp16

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

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

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

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

---

# Qwen-Image-2.1-MNN-fp16

**Qwen-Image-2.1** converted to [MNN](https://github.com/alibaba/MNN) for on-device text-to-image
inference — no torch, no diffusers, no 33 GB checkpoint. The text encoder and the DiT are fp16
weights, the VAE is fp32. Quantized alternatives: `Qwen-Image-2.1-MNN-int8` (21.4 GB) and
`Qwen-Image-2.1-MNN-int4` (14.4 GB).

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

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

## Files

| file | size | precision |
| --- | --- | --- |
| `dit.mnn` + `dit.mnn.weight` | 14.2 GB | fp16 |
| `text_encoder.mnn` + `text_encoder.mnn.weight` | 15.1 GB | fp16 |
| `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 |

The tokenizer, the flow-matching scheduler and the joint-sequence bookkeeping (3-axis RoPE,
block-causal mask, modulation rows) are plain numpy in the CLI; only the transformer, the text
encoder and the VAE run in MNN.

## Verification

Each graph was checked against its source before publishing:

| graph | vs its ONNX source | vs the released model |
| --- | --- | --- |
| text encoder | 8.4e-4 (max rel) | 8.5e-5 (mean abs drift / max abs value) |
| DiT | 1.7e-2 (max rel, T=1120) | 3.0e-2 (vs a torch fp16 forward, T=4192) |
| VAE decoder | 1.0e-3 … 4.2e-3 | — |
| VAE encoder | 2.1e-3 … 3.6e-3 | — |

End to end (8 steps, 512 px, same latents): the MNN pipeline's latents drift from 4.9e-3 (step 1)
to 2.9e-2 (step 8) relative to the released pipeline's own fp16 run, image PSNR 43.6 dB. The
released model compared against *itself* across dtypes (fp16 vs bf16, same seed and latents)
drifts up to 2.0e-1 — the conversion is closer to the model than the model is to itself once the
dtype moves.

## Backend support

- **CPU, `precision=high`: the verified path.** MNN's `low` precision swaps the CPU kernels to
  fp16 arithmetic, which overflows this model's residual stream.
- Metal: broken in MNN 3.6.1 — its tensor-API probe fails to compile against the macOS 26 SDK
  (`static_assert … At least one of M or N must be a multiple of 16`) and the fallback kernels
  return garbage, exactly as seen with other MNN models on this OS. MNN master fixed the probe;
  a local master build renders the VAE correctly on Metal (max rel 1.5e-3) and 3.1x faster than
  CPU (2.3 s against 7.2 s for a 512 px decode) and the DiT forward is numerically correct too
  (max rel 2.2e-3 against CPU) — but there it is ~4x *slower* than CPU (95.7 s against 24.1 s at
  T=1120), so CPU stays the fastest full path even once the fix ships. The pip wheel also cannot
  load a locally built `libMNN.dylib` (the process is killed on load), so this needs an upstream
  MNN release either way.

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