ascend-ai-coding/awesome-ascend-skills/diffusers-ascend-env-setup

Claude Code and agent skill by ascend-ai-coding/awesome-ascend-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

HuggingFace Diffusers 环境配置指南,用于华为昇腾 NPU。覆盖 CANN 版本检测、PyTorch + torch_npu 安装、Diffusers 库安装及环境验证。当用户需要在昇腾 NPU 上配置 Diffusers 环境时使用。

Install

npx vskill@latest install ascend-ai-coding/awesome-ascend-skills/diffusers-ascend-env-setup

SKILL.md

Diffusers 昇腾 NPU 环境配置

本 Skill 指导用户在华为昇腾 NPU 上配置 HuggingFace Diffusers 开发环境。

快速开始

4 步完成环境搭建:

bash
# 1. 激活 CANN 环境(自动检测版本)
if [ -d "/usr/local/Ascend/cann" ]; then
source /usr/local/Ascend/cann/set_env.sh
else
source /usr/local/Ascend/ascend-toolkit/set_env.sh
fi
# 2. 安装 PyTorch + torch_npu(版本自动匹配)
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install torch-npu # 自动匹配已安装的 PyTorch 版本
# 3. 安装 Diffusers
pip install diffusers["torch"] transformers
# 4. 验证环境
python scripts/validate_environment.py

安装概览

步骤详细指南
CANN 验证references/cann-versions.md
PyTorch + torch_npureferences/installation.md
Diffusers 安装references/installation.md

版本兼容性

组件版本说明
CANN8.0.RC1+NPU 支持必需
PyTorch2.1.0 - 2.8.0含 torch_npu 扩展
Diffusers0.28.0+支持 SDXL、SD3、Flux

torch_npu 版本匹配:

  • 默认安装与 PyTorch 版本相同的 torch_npu:pip install torch-npu
  • 如安装失败,请参考 torch_npu Release 查看完整版本配套表

示例(CANN 8.3.RC1):

PyTorchtorch_npuPython
2.8.02.8.03.9 - 3.11
2.7.12.7.13.9 - 3.11
2.6.02.6.0.post33.9 - 3.11

环境验证

运行验证脚本:

bash
python scripts/validate_environment.py

检查项:

检查项说明
CANN 安装目录存在且环境变量已设置
PyTorchimport 成功,版本匹配
torch_npuimport 成功,NPU 可见
Diffusersimport 成功
numpy版本 < 2.0

参考资源

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
128
Repository forks
51
7-day trend score
24

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 4 Jul 2026, 4 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ascend-ai-coding/awesome-ascend-skills/diffusers-ascend-env-setup/badge)](https://verified-skill.com/skills/ascend-ai-coding/awesome-ascend-skills/diffusers-ascend-env-setup)

Something wrong with this skill or its page? Tell us.