Implementation:Alibaba MNN Diffusion HuggingFace Download
Appearance
| Field | Value |
|---|---|
| implementation_name | Diffusion_HuggingFace_Download |
| schema_version | 0.3.0 |
| impl_type | External Tool Doc |
| domain | Stable Diffusion Deployment |
| stage | Model Acquisition |
| source_file | N/A (user-side) |
| external_deps | git, git-lfs |
| last_updated | 2026-02-10 14:00 GMT |
Summary
This implementation describes how to download Stable Diffusion model weights from HuggingFace using git with git-lfs support. The downloaded repository contains all pipeline components (text encoder, UNet, VAE, tokenizer) needed for subsequent ONNX export and MNN conversion.
API
git lfs install
git clone https://huggingface.co/<model_identifier>
Key Parameters
| Parameter | Description | Example Values |
|---|---|---|
| model_identifier | HuggingFace repository path for the target Stable Diffusion model | runwayml/stable-diffusion-v1-5, TASUKU2023/Chilloutmix, IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1
|
Inputs
- A valid HuggingFace model identifier string (e.g.,
runwayml/stable-diffusion-v1-5)
Outputs
A local directory containing the complete diffusers-format model repository:
text_encoder/-- CLIP text encoder weights (PyTorch)unet/-- UNet denoising network weights (PyTorch)vae/-- VAE encoder and decoder weights (PyTorch)tokenizer/-- Vocabulary file (vocab.json) and merge file (merges.txt)scheduler/-- Scheduler configurationmodel_index.json-- Pipeline manifest
Usage Examples
Download stable-diffusion-v1-5:
git lfs install
git clone https://huggingface.co/runwayml/stable-diffusion-v1-5
Download Taiyi Chinese model:
git lfs install
git clone https://huggingface.co/IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1
Download Chilloutmix:
git lfs install
git clone https://huggingface.co/TASUKU2023/Chilloutmix
Notes
- Run
git lfs installbefore cloning to ensure large binary files are fetched correctly. Without git-lfs, only pointer files will be downloaded. - For ModelScope (Chinese mirror), replace the HuggingFace URL with the equivalent ModelScope repository URL.
- Ensure sufficient disk space (4-6 GB per model) before cloning.
Related Pages
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment