显存优化的全方位解决方案
针对不同硬件环境推荐对应方案:
- 蒸馏加速技术: Use
anisoraV2_npu
版本的小型化模型,显存占用降低40%,需在推理时添加--lite_mode
parameters - 华为NPU专属方案:昇腾910B通过
--device npu
参数启用,利用芯片级内存压缩技术 - 分块渲染策略: Modification
inference.py
hit the nail on the headchunk_size
参数(建议设为8-16),将长视频分片段生成
通用优化技巧:1)降低输出分辨率(默认768×432可降至512×288);2)减少文本提示长度(控制在20字内);3)关闭不必要的模块如--disable_guided
。若持续爆显存,建议改用云服务或申请B站提供的算力支持。
This answer comes from the articleIndex-AniSora: Bilibili open source anime video generation toolThe