大家好,今天我们来看看如何本地源码部署开源项目:Paints-Undo 实现画画不求人,导入一张图片系统自动分析将所有的画画步骤进行分解生成视频,文中所介绍的开源项目都在本地部署运行成功,感兴趣的小伙伴们可放心大胆的去尝试。本项目运行电脑需要有英伟达显卡的支持,请先安装cuda 和对应的pytorch。
准备工作:
1.安装cuda(找对自己电脑的cuda版本很重要)
nvcc –version 查看版本 安装cuda
CUDA Toolkit 12.1 Downloads | NVIDIA Developer
2.安装对应pytorch,打开pytorch官网,根据自己的电脑配置选择对应的安装命令进行安装。
PyTorch
项目介绍:
Paints-Undo可以将任何一张图像“拆解”成一个25秒的图像绘制过程视频,从线稿到填色以及局部细节调整的全过程。Paints-Undo 提供了一系列模型,这些模型将图像作为输入,然后输出该图像的绘制序列。它展示了各种人类绘画行为,包括草图、墨迹、着色、阴影、变换、左右翻转、颜色曲线调整、改变图层的可见性,甚至在绘图过程中改变整体构思等。
源码部署
git clone https://github.com/lllyasviel/Paints-UNDO.git cd Paints-UNDO conda create -n paints_undo python=3.10 conda activate paints_undo pip install xformers pip install -r requirements.txt python gradio_app.py
运行过程中如果缺an zhuang 包,我们在命令行输入pip install xxx-对应的安装包即可。
运行后打开页面:
导入一张图,点击Generate Key Frames
点击GenerateVideo ,生成的相应地视频。
好啦,生成的效果就是开头播放的视频,大伙还满意不?
安装过程中遇到的报错处理
报错:A matching Triton is not available, some optimizations will not be enabled. Error caught was: No module named 'triton'
下载:
Python 3.10 https://huggingface.co/madbuda/triton-windows-builds/resolve/main/triton-2.1.0-cp310-cp310-win_amd64.whl Python 3.11 https://huggingface.co/madbuda/triton-windows-builds/resolve/main/triton-2.1.0-cp311-cp311-win_amd64.whl
安装
pip install triton-2.1.0-cp311-cp311-win_amd64.whl
报错:
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.1.2+cu121 with CUDA 1201 (you have 2.3.1+cu121) Python 3.11.7 (you have 3.11.7) Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers) Memory-efficient attention, SwiGLU, sparse and more won't be available. Set XFORMERS_MORE_DETAILS=1 for more details
原因:xformers版本和torch不匹配。
访问https://anaconda.org/xformers/xformers/files, 找个对应的版本 下载对应的包 conda install xformers-0.0.16-py310_cu11.3_pyt1.12.1.tar.bz2 或者重新安装对应的PyTorch pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu121
限时福利:已关注私信我,可得pycharm破解大法,亲测有效,有效期到2123年应该够小伙伴们使用了ß。
感谢大家的支持,希望得到点赞与已关注,我们下期见。
暂无评论内容