Skip to content

Commit 9cc1697

Browse files
committed
Docs:Supplement NPU environment installation document
1 parent 8f1d10f commit 9cc1697

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

docs/en/Pipeline_Usage/Setup.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm6
3030

3131
* **Ascend NPU**
3232

33-
Ascend NPU support is provided via the `torch-npu` package. Taking version `2.1.0.post17` (as of the article update date: December 15, 2025) as an example, run the following command:
34-
35-
```shell
36-
pip install torch-npu==2.1.0.post17
37-
```
33+
1. Install [CANN](https://www.hiascend.com/document/detail/zh/canncommercial/83RC1/softwareinst/instg/instg_quick.html?Mode=PmIns&InstallType=local&OS=openEuler&Software=cannToolKit) through official documentation.
34+
35+
2. Install from source
36+
```shell
37+
git clone https://github.com/modelscope/DiffSynth-Studio.git
38+
cd DiffSynth-Studio
39+
# aarch64/ARM
40+
pip install -e .[npu_aarch64] --extra-index-url "https://download.pytorch.org/whl/cpu"
41+
# x86
42+
pip install -e .[npu]
3843

3944
When using Ascend NPU, please replace `"cuda"` with `"npu"` in your Python code. For details, see [NPU Support](/docs/en/Pipeline_Usage/GPU_support.md#ascend-npu).
4045

docs/zh/Pipeline_Usage/Setup.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm6
3030

3131
* Ascend NPU
3232

33-
Ascend NPU 通过 `torch-npu` 包提供支持,以 `2.1.0.post17` 版本(本文更新于 2025 年 12 月 15 日)为例,请运行以下命令
34-
35-
```shell
36-
pip install torch-npu==2.1.0.post17
37-
```
33+
1. 通过官方文档安装[CANN](https://www.hiascend.com/document/detail/zh/canncommercial/83RC1/softwareinst/instg/instg_quick.html?Mode=PmIns&InstallType=local&OS=openEuler&Software=cannToolKit)
34+
35+
2. 从源码安装
36+
```shell
37+
git clone https://github.com/modelscope/DiffSynth-Studio.git
38+
cd DiffSynth-Studio
39+
# aarch64/ARM
40+
pip install -e .[npu_aarch64] --extra-index-url "https://download.pytorch.org/whl/cpu"
41+
# x86
42+
pip install -e .[npu]
3843

3944
使用 Ascend NPU 时,请将 Python 代码中的 `"cuda"` 改为 `"npu"`,详见[NPU 支持](/docs/zh/Pipeline_Usage/GPU_support.md#ascend-npu)。
4045

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,17 @@ classifiers = [
3434

3535
[tool.setuptools.packages.find]
3636

37+
[project.optional-dependencies]
38+
npu_aarch64 = [
39+
"torch==2.7.1",
40+
"torch-npu==2.7.1",
41+
"torchvision==0.22.1"
42+
]
43+
npu = [
44+
"torch==2.7.1+cpu",
45+
"torch-npu==2.7.1",
46+
"torchvision==0.22.1+cpu"
47+
]
48+
3749
[tool.setuptools]
3850
include-package-data = true

0 commit comments

Comments
 (0)