原文链接指路:https://mp.weixin.qq.com/s/0ttZoxfNyrb8Vte3ikECXQ
Cloud Studio + DeepSeek确实很强,但是只能对话,有没有能够用Cloud Studio 画图甚至视频的方法?
有的兄弟,有的!
使用Cloud Studio内置的DeepSeek只是我们的入门,我们接下来要白嫖Cloud Studio的显卡,来尝试运行各种好玩有趣的项目。
通义万相刚刚发布的Wan2.1,就可以来尝试一下。
快速上手可以参考之前两期文章:涨知识!云端私有知识库,随时随地DeepSeek一下!腾讯云究极薅羊毛部署最近爆火的DeepSeek
1. 开启加速
之前一直有用户反馈CloudStudio的工作空间使用灵活,DIY可玩性较高,但拉取海外仓库速度很慢,不得不转向国内仓库,或者自己想办法加速。基于此类需求,CloudStudio已上线加速代理能力,方便拉取Github仓库与huggingface项目
git config --global http.proxy http://proxy.cloudstudio.work:8081
git config --global https.proxy http://proxy.cloudstudio.work:8081
echo 'export http_proxy=http://proxy.cloudstudio.work:8081' >> ~/.bashrc
echo 'export HTTP_PROXY=http://proxy.cloudstudio.work:8081' >> ~/.bashrc
echo 'export https_proxy=http://proxy.cloudstudio.work:8081' >> ~/.bashrc
echo 'export HTTPS_PROXY=http://proxy.cloudstudio.work:8081' >> ~/.bashrc
echo 'export http_proxy=http://proxy.cloudstudio.work:8081' >> ~/.zshrc
echo 'export HTTP_PROXY=http://proxy.cloudstudio.work:8081' >> ~/.zshrc
echo 'export https_proxy=http://proxy.cloudstudio.work:8081' >> ~/.zshrc
echo 'export HTTPS_PROXY=http://proxy.cloudstudio.work:8081' >> ~/.zshrc
source ~/.zhsrc
实测速度爆表了!
2. 克隆项目及准备环境
git clone https://github.com/Wan-Video/Wan2.1.git
cd Wan2.1
pip install -r requirements.txt
pip install "huggingface_hub[cli]"
huggingface-cli download Wan-AI/Wan2.1-T2V-1.3B --local-dir ./Wan2.1-T2V-1.3B
3. 尝试生成
预期效果是这样的,这个视频用的是720P的模型生成的。
在Cloud Studio上我们只能用480P的模型
python generate.py --task t2v-1.3B --size 832*480 --ckpt_dir ./Wan2.1-T2V-1.3B --offload_model True --t5_cpu --sample_shift 8 --sample_guide_scale 6 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
4. 遇到代码问题
是Tesla T4显卡,不支持FlashAttention,需要修改代码,
在Wan2.1/wan/modules/attention.py中,把148行修改为:
if 0: # FLASH_ATTN_2_AVAILABLE or FLASH_ATTN_3_AVAILABLE:
并将Wan2.1/wan/models/model.py中,第10行修改为:
from .attention import attention as flash_attention
5. 爆显存
想要生成的帧数较多,就会爆显存,只能一点点往下降
6. 继续调整参数
python generate.py --frame_num 11 --task t2v-1.3B --size 832*480 --ckpt_dir ./Wan2.1-T2V-1.3B --offload_model True --t5_cpu --sample_shift 8 --sample_guide_scale 6 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
把生成的帧数调整到11帧,不到1秒的视频,终于运行起来了!
这个模型自带"闪电侠"属性!它的因果3D VAE架构比同行快2.5倍,相当于给你的显卡装上了氮气加速装置(隔壁大模型已经哭晕在厕所)
使用Full Attention机制就像给AI装了"时空望远镜",保证你生成的视频不会出现:
继续探索Cloud Studio吧,热爱学习的少年!
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。