ONNX Model Zoo

fazzy007/stable-diffusion-2-1-base-mnn

By fazzy007 · ↓ 0 · ♥ 1 · Updated 2025-08-22

What's in this repo

This page lists the files in fazzy007/stable-diffusion-2-1-base-mnn.

  • No .onnx files in this repository
  • 8 files, including 5 .mnn, 1 .md, 1 .json
  • Last updated 2025-08-22

ONNX files

This repository has no .onnx files. See the full file list on the right for other formats.

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Stable Diffusion 2.1 (MNN Conversion)

This repository contains a Stable Diffusion 2.1 model converted to the MNN format for efficient inference on CPU.
The base model is stabilityai/stable-diffusion-2-1-base.

Conversion Process

  1. Exported the original model to ONNX using MNN:

    cd mnn_path/transformers/diffusion/export
    python onnx_export.py \
        --model_path stabilityai/stable-diffusion-2-1-base \
        --output_path output/path
    
    
  2. Converted each component from ONNX → MNN:

    # Clip (text encoder)
    ./MNNConvert -f ONNX --modelFile ./text_encoder.onnx --MNNModel ./text_encoder.mnn --fp16
    # Unet 
    ./MNNConvert -f ONNX --modelFile ./unet.onnx --MNNModel ./unet.mnn --weightQuantBits 8 --weightQuantAsymmetric --weightQuantBlock 32
    # VAE decoder 
    ./MNNConvert -f ONNX --modelFile ./vae_decoder.onnx --MNNModel ./vae_decoder.mnn --fp16
    

Model info

stable-diffusion mnn cpu onnx image-generation base_model:stabilityai/stable-diffusion-2-1-base base_model:finetune:stabilityai/stable-diffusion-2-1-base license:creativeml-openrail-m region:us
↓ 0 ♥ 1

Created: 2025-08-21

Updated: 2025-08-22

View on Hugging Face

Files (8)

.gitattributes
README.md
clip_fp16.mnn
tokenizer/tokenizer_config.json
unet_fp16.mnn
unet_int8.mnn
vae_decoder_fp16.mnn
vae_encoder_fp16.mnn

Related models