将 FloodDiffusion 轻量化文本到动作生成模型部署至华为昇腾 Ascend NPU 的适配成果。
FloodDiffusionTiny 是面向文本驱动人体运动生成任务的轻量级模型,采用 Latent Diffusion Forcing(LDF)框架,能够根据自然语言描述实时生成连续的动作序列。本次适配将其推理后端从 CUDA 成功迁移至华为昇腾 910B NPU,并搭建了完整的服务化推理链路。
第一步,启动 FastAPI 推理服务:
python3 service.py 8006第二步,验证服务健康状态:
curl http://127.0.0.1:8006/health第三步,发起推理请求:
curl -X POST http://127.0.0.1:8006/generate \
-H "Content-Type: application/json" \
-d '{"text": "a person walking forward", "length": 60}'执行以下命令确认服务各功能正常运转:
# 健康检查
curl http://127.0.0.1:8006/health
# 单文本推理
curl -X POST http://127.0.0.1:8006/generate \
-H "Content-Type: application/json" \
-d '{"text": "a person walking", "length": 30}'
# 多文本批处理
curl -X POST http://127.0.0.1:8006/generate \
-H "Content-Type: application/json" \
-d '{"text": ["walk", "run"], "length": [30, 20]}'在 Ascend 910B 上使用默认 20 步去噪的测试结果:
| 文本描述 | 生成帧数 | 推理耗时 | 特征维度 |
|---|---|---|---|
| a person walking forward | 237帧 | 12.5s | 237 x 263 |
| a person waving their hand | 157帧 | 8.1s | 157 x 263 |
| a person jumping up and down | 197帧 | 10.1s | 197 x 263 |
生成的 HumanML3D 特征数据需满足以下标准: