Metadata-Version: 2.4
Name: mindiesd
Version: 3.3.1
Summary: MindIE Stable Diffusion inference engine for Ascend NPUs
Author: Huawei Technologies Co., Ltd.
License: Mulan PSL v2
Project-URL: Homepage, https://gitcode.com/Ascend/MindIE-SD
Project-URL: Repository, https://gitcode.com/Ascend/MindIE-SD
Project-URL: Documentation, https://gitcode.com/Ascend/MindIE-SD/tree/master/docs
Project-URL: Issues, https://gitcode.com/Ascend/MindIE-SD/issues
Keywords: ascend,diffusion,mindie,npu,stable-diffusion
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
License-File: THIRD_PARTY_LICENSES.txt
Requires-Dist: torch
Requires-Dist: torch_npu
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python

<!-- markdownlint-disable-next-line MD041 -->
<p align="center">
    <img alt="MindIE SD" src="docs/figures/MindIE-SD-logo-ascend-red-square-dot-v5.png">
</p>

<p align="center">
    <a href="https://mindie-sd.readthedocs.io/en/latest/zh/">
        <img alt="Documentation" src="https://img.shields.io/badge/Docs-Read%20the%20Docs-8CA1AF">
    </a>
    <a href="https://pypi.org/project/mindiesd/">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/mindiesd?logo=pypi&logoColor=white">
    </a>
    <a href="#wechat-community">
        <img alt="Community QR Code" src="https://img.shields.io/badge/Community-WeChat-07C160">
    </a>
    <a href="./LICENSE.md">
        <img alt="License" src="https://img.shields.io/badge/License-Mulan-blue">
    </a>
    <a href="https://meeting.ascend.osinfra.cn/?sig=sig-MindIE-SD">
        <img alt="SIG Meetings" src="https://img.shields.io/badge/Meetings-SIG-0A7B83">
    </a>
    <a href="https://zread.ai/verylucky01/M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OTg0IDUuMzEzNTYgMTAuNjg1IDUuNjAwMSAxMS4wMzg0IDUuNjAwMUgxMy43NTg0QzE0LjExMTkgNS42MDAxIDE0LjM5ODQgNS4zMTM1NiAxNC4zOTg0IDQuOTYwMVYyLjI0MDFDMTQuMzk4NCAxLjg4NjY0IDE0LjExMTkgMS42MDAxIDEzLjc1ODQgMS42MDAxWiIgZmlsbD0iI2ZmZiIvPgo8cGF0aCBkPSJNNCAxMkwxMiA0TDQgMTJaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00IDEyTDEyIDQiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L3N2Zz4K&logoColor=ffffff">
    </a>
    <a href="https://deepwiki.com/verylucky01/MindIE-SD">
        <img alt="DeepWiki" src="https://img.shields.io/badge/DeepWiki-Ask_AI-_.svg?style=flat&color=0052D9&labelColor=000000&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==">
    </a>
</p>

English | [简体中文](./README.md)

## Introduction

**MindIE SD** (Mind Inference Engine Stable Diffusion) is the visual generation inference model suite of MindIE. Its goal is to provide an end-to-end inference solution for Stable Diffusion (SD) series large models on Huawei Ascend hardware and its software stack. The software system internally integrates various functional modules and provides a unified programming interface externally.

For supported models and feature stacking, see [Model/Framework Support](docs/en/features/supported_matrix.md).

## 📢 Latest News

- 11/18/2026: [MindIE SD quantized attention is now integrated into SGLang main](https://github.com/sgl-project/sglang/pull/46029) 🤝
- 11/11/2026: Completed [MiniMax-H3-Image Day0 inference adaptation on Ascend](examples/minimax-h3-image/infer.md) 🚀
- 09/23/2026: [MXAttention paper](docs/tech_report/MXAttention.pdf) has been submitted to ICLR ([arXiv:2607.24377](https://arxiv.org/abs/2607.24377)) 📄
- 09/20/2026: Completed [high-performance Qwen-Image-2.1 inference adaptation and optimization on Ascend](examples/qwen-image-2.1/infer.md) 🚀
- 09/04/2026: MindIE SD supports the Lightx2v framework to accelerate MiniMax H3 on 950PR&950DT products
- 08/03/2026: Completed [high-performance MiniMax-H3 inference adaptation and optimization on Ascend](examples/minimax-h3/infer.md) 🚀
- 07/2026: [RotateAttention](docs/tech_report/RotateAttention.pdf) was accepted to ECCV 2026 🏆
- 06/2026: Enhanced low-precision inference, multimodal MoE, sparse attention, and the deployment ecosystem ⚡
- 05/28/2026: [Cache-DiT completed its MindIE SD integration](https://github.com/vipshop/cache-dit/pull/1004) 🤝
- 05/2026: Completed multimodal MoE inference capability development and multi-model adaptation validation 🧠
- 04/2026: Enhanced graph compilation, operator fusion, and sparse computation capabilities ⚙️
- 03/2026: Extended W4A4 and MXFP4 quantization capabilities ⚡
- 02/2026: Added sparse attention operators and Dynamic EPLB 🧩
- 01/2026: Added memory optimization capabilities and serving examples 💾
- 12/31/2025: MindIE SD provides sparse Attention computation capability ⚡
- 12/25/2025: vLLM Omni x MindIE SD achieves native high-performance Ascend inference for Qwen-Image-Edit-2511 / Qwen-Image-Layered 🚀
- 11/30/2025: MindIE SD officially open-sourced and available to the public! 🎉

## Installation Guide

```bash
pip install mindiesd
```

For other installation methods and environment dependencies, see [Installation Guide](docs/zh/installation.md).

## Architecture Overview

For MindIE SD architecture and key features, see [Architecture Overview](docs/zh/architecture.md).

![MindIE SD Architecture Diagram](https://raw.gitcode.com/Ascend/MindIE-SD/raw/dev/docs/figures/architecture_overview_en.png)

## Quick Start

[Quick Start](docs/zh/quick_start.md): Using Wan2.1 as an example, introduces the overall acceleration effect with MindIE SD.

## Developer Documentation

- [Contribution Guide](docs/zh/developer_guide/contribution_guide.md): Explains how to submit Issues, Pull Requests, and coding standards.
- [AI Agent Support](.agents/README.md): Introduces the default skills used in the repository and the agent-assisted development workflow.
- [Test Verification](docs/zh/developer_guide/test.md): Introduces the unit test example execution workflow.

## Ecosystem Support

The following projects have integrated MindIE SD as a multimodal inference backend:

- [vLLM Omni](https://github.com/vllm-project/vllm-omni)
- [Cache-DiT](https://github.com/vipshop/cache-dit)
- [Lightx2v](https://github.com/ModelTC/lightx2v)
- [SGLang](https://github.com/sgl-project/sglang)

## 🙏 Acknowledgment

We thank the [CANN ops-transformer](https://gitcode.com/cann/ops-transformer) and [CANN ops-nn](https://gitcode.com/cann/ops-nn) communities for their operator source code.

- **Migration and multimodal performance optimization**: The local operators `QuantFlashAttn`, `EagleFusedInferAttentionScore`, `EagleBlockSparseAttention`, and `EagleFfn` are migrated from CANN [QuantFlashAttn](https://gitcode.com/cann/ops-transformer/tree/master/attention/quant_flash_attn), [FusedInferAttentionScore](https://gitcode.com/cann/ops-transformer/tree/master/attention/fused_infer_attention_score), [BlockSparseAttention](https://gitcode.com/cann/ops-transformer/tree/master/attention/block_sparse_attention), and [FFN](https://gitcode.com/cann/ops-transformer/tree/master/ffn/ffn), respectively, and optimized for multimodal inference.
- **Development based on CANN operators**: `EagleQuantBlockSparseAttention` builds on CANN [BlockSparseAttention](https://gitcode.com/cann/ops-transformer/tree/master/attention/block_sparse_attention) to implement mixed-precision block-sparse attention. `quant_four_over_six_a5` builds on CANN [dynamic MX quantization](https://gitcode.com/cann/ops-nn/tree/master/quant/dynamic_mx_quant) infrastructure to implement the Four Over Six quantization extension.

We thank the following contributors for their work on the related CANN operators: [cardiac_index](https://gitcode.com/cardiac_index), [XiyueL](https://gitcode.com/XiyueL), [jiang-lirui](https://gitcode.com/jiang-lirui), [monologue815](https://gitcode.com/monologue815), [chenyizhou](https://gitcode.com/chenyizhou), [liwenguihw](https://gitcode.com/liwenguihw).

<a id="paper-citations"></a>

## Paper Citations

<pre><details><summary>Show more
<code>@misc{yu2026mxattentiondatafreeoptimalscaling,
      title={MXAttention: Data-Free Optimal Scaling and Pre-Normalization Quantization for MXFP4 Attention},
      author={Jianlin Yu and Jing Lin and Linghui Kong and Aiyue Chen and Weiyi Sun and Chenyu Zeng and Wangli Lan and Jinxi Li and Zhuo Zheng and Ziyang Yue and Danning Ke and Fei Yi and Tianchi Hu and Yuan Ding and Yiwu Yao and Junsong Wang},
      year={2026},
      eprint={2607.24377},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2607.24377},
}

@misc{liu2026rotateattentionropeawarerotationrange,
      title={RotateAttention: RoPE-Aware Rotation and Range Rectification for INT4 Quantized Attention in Video Generation},
      author={Yaofu Liu and Wanli Lan and Jinxi Li and Binhang Yuan and Harry Yang},
      year={2026},
      eprint={2607.02584},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2607.02584},
}</code></summary><code>

@misc{RainFusion2.0@2025,
    title = {RainFusion2.0: Temporal-Spatial Awareness and Hardware-Efficient Block-wise Sparse Attention},
    author = {Aiyue Chen and Yaofu Liu and Junjian Huang and Guang Lian and Yiwu Yao and Wangli Lan and Jing Lin and Zhixin Ma and Tingting Zhou and Harry Yang},
    year = {2025},
    url = {https://gitcode.com/Ascend/MindIE-SD/blob/dev/docs/tech_report/RainFusion2.0.pdf}
}

@misc{zhang2025slasparsitydiffusiontransformers,
      title={SLA: Beyond Sparsity in Diffusion Transformers via Fine-Tunable Sparse-Linear Attention},
      author={Jintao Zhang and Haoxu Wang and Kai Jiang and Shuo Yang and Kaiwen Zheng and Haocheng Xi and Ziteng Wang and Hongzhou Zhu and Min Zhao and Ion Stoica and Joseph E. Gonzalez and Jun Zhu and Jianfei Chen},
      year={2025},
      eprint={2509.24006},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2509.24006},
}

@misc{zhang2025sageattentionaccurate8bitattention,
      title={SageAttention: Accurate 8-Bit Attention for Plug-and-play Inference Acceleration},
      author={Jintao Zhang and Jia Wei and Haofeng Huang and Pengle Zhang and Jun Zhu and Jianfei Chen},
      year={2025},
      eprint={2410.02367},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2410.02367},
}

@misc{ashkboos2024quarotoutlierfree4bitinference,
      title={QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs},
      author={Saleh Ashkboos and Amirkeivan Mohtashami and Maximilian L. Croci and Bo Li and Pashmina Cameron and Martin Jaggi and Dan Alistarh and Torsten Hoefler and James Hensman},
      year={2024},
      eprint={2404.00456},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2404.00456},
}

@misc{cook2026sixaccuratenvfp4quantization,
      title={Four Over Six: More Accurate NVFP4 Quantization with Adaptive Block Scaling},
      author={Jack Cook and Junxian Guo and Guangxuan Xiao and Yujun Lin and Keith Wyss and Mahdi Nazemi and Asit Mishra and Carlo del Mundo and Tijmen Blankevoort and Song Han},
      year={2026},
      eprint={2512.02010},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2512.02010},
}</code></details></pre>

<a id="wechat-community"></a>

## Contact Us

Join the MindIE SD WeChat community by scanning the group QR code below. If the group QR code has expired, scan the personal WeChat QR code to request an invitation.

<div align="center">

| WeChat Group | Personal WeChat (if the group QR code has expired) |
| --- | --- |
| ![WeChat Group QR Code](https://raw.gitcode.com/Ascend/MindIE-SD/raw/dev/docs/figures/wx_sd.jpg) | ![Personal WeChat QR Code](https://raw.gitcode.com/Ascend/MindIE-SD/raw/dev/docs/figures/wx_lwl.jpg) |

</div>
