ComfyUI中用wget下载、安装节点
用wget的好处 是在网络不好时,可以一直重试,直到成功。
1、下载好ComfyUI包解压后,便是安装所需节点、下载模型,使用 git clone 安装节点,有时候网络并不是那么通畅,安装时有失败,而通过下载节点压缩包解压安装,好像就容易不少。
通过浏览器下载节点压缩包当然可以,但我更喜欢通过命令行下载安装(因为我常常要安装)(前提当然需要你记录下节点github地址,当然也可以记录压缩包下载地址),觉得命令行更方便,节点压缩包下载地址,就是节点github地址+/archive/refs/heads/main.zip,例如节点地址:https://github.com/shadowcz007/comfyui-liveportrait ,则节点压缩包下载地址是:https://github.com/shadowcz007/comfyui-liveportrait/archive/refs/heads/main.zip ,
2、为了方便,设置环境变量path
set path=G:\Green Soft\wget;C:\Program Files\7-Zip;%path%
3、用 wget 下载节点(下载wget)
wget --progress=bar --show-progress https://github.com/kijai/ComfyUI-LivePortraitKJ/archive/refs/heads/main.zip -O G:\Downloads\DownNode\ComfyUI-LivePortraitKJ.zip
wget参数说明: --progress=bar 进度条类型
--show-progress 以任何详细模式显示进度条
-O G:\Downloads\DownNode\ComfyUI-LivePortraitKJ.zip 将文件保存到
上面只是解析可能用到的wget参数,实际使用中,-O参数可以不用(最后发现还是要用^_^),直接去到custom_nodes路径下载,并解压。
cd \ComfyUI_windows_portable-2\ComfyUI\custom_nodes
wget --progress=bar --show-progress https://github.com/kijai/ComfyUI-LivePortraitKJ/archive/refs/heads/main.zip
还有用wget的好处 是在网络不好时,可以一直重试,直到成功:
3、用7-Zip中的命令行命令7z解压安装节点(下载7-Zip)
7z x main.zip -y
解压的路径名称,会比通过 git clone 安装的,多了-main,可以重命名去掉-main,也可以不理(后来发现有些节点与路径名相关,多了 -main 会发生错误,所以还是要重命名去掉-main)。
将所有要安装的节点,写到1个批处理中,便可以批量安装,安装完后,启动ComfyUI时,会自动安装节点依赖(requirements.txt),除了一些模型要再下载放入对应路径外。
4、发现当要通过批处理下载多个节点时,可能7z还未完全释放文件main.zip,导致wget不能写入main.zip,而是写入main.zip.1 ....,所以,还是需要 -O参数 ,指定不会重复的文件名保存。
这是我安装节点的一个批处理(自动下载ComfyUI包并解压,安装节点):
(2024.10.24想要下载最新ComfyUI_windows_portable_nvidia.7z时,由于网络原因,不管是否架梯子,用浏览器下载,竟然都无法成功,最后还是用wget才下载成功)
echo off
echo 安装到磁盘,只需要修改下面变量set install_driver=C:及Set ComfyUI_path=\ComfyUI_windows_portable即可安装到不同的磁盘及路径中
set install_driver=G:
Set ComfyUI_path=\ComfyUI_windows_portable
echo 设置wget路径
set wget_path=G:\GreenSoft\wget
set path=C:\Program Files\7-Zip;%path%;%wget_path%
set path=%path%;%install_driver%%ComfyUI_path%\python_embeded\Scripts
set custom_nodes_path=%ComfyUI_path%\ComfyUI\custom_nodes
echo 将ComfyUI_windows_portable_nvidia.7z下载到当前路径
wget --progress=bar --show-progress https://github.com/comfyanonymous/ComfyUI/releases/latest/download/ComfyUI_windows_portable_nvidia.7z
7z x ComfyUI_windows_portable_nvidia.7z -y
set downUiDir=%cd%
%install_driver%
cd \
7z x %downUiDir%\ComfyUI_windows_portable_nvidia.7z -y
move \ComfyUI_windows_portable %ComfyUI_path%
cd %custom_nodes_path%
echo 下载ComfyUI,先解压到根路径,再移动到指定路径,并安装几个重要节点
echo 如果wget不能运行,说明路径不对或没有wget,请Ctrl + C终止运行
echo 如果没有wget,请从https://eternallybored.org/misc/wget/下载wget
echo 如果根路径没有写入权限,请Ctrl + C终止运行,然后单独下载解压ComfyUI安装包再后执行后续的节点安装
echo 如果7-Zip不能运行,请Ctrl + C终止运行,安装7-Zip后再运行
echo 如果路径custom_nodes不存在,请Ctrl + C终止运行
echo 按任意键继续....
pause
wget --progress=bar --show-progress https://github.com/ltdrdata/ComfyUI-Manager/archive/refs/heads/main.zip -O main1.zip
7z x main1.zip -y
move ComfyUI-Manager-main ComfyUI-Manager
wget --progress=bar --show-progress https://github.com/AIGODLIKE/AIGODLIKE-COMFYUI-TRANSLATION/archive/refs/heads/main.zip -O main2.zip
7z x main2.zip -y
move AIGODLIKE-COMFYUI-TRANSLATION-main AIGODLIKE-COMFYUI-TRANSLATION
wget --progress=bar --show-progress https://github.com/crystian/ComfyUI-Crystools/archive/refs/heads/main.zip -O main3.zip
7z x main3.zip -y
move ComfyUI-Crystools-main ComfyUI-Crystools
cd ComfyUI-Crystools
..\..\..\python_embeded\python.exe -m pip install -r requirements.txt
cd %custom_nodes_path%
wget --progress=bar --show-progress https://github.com/rgthree/rgthree-comfy/archive/refs/heads/main.zip -O main4.zip
7z x main4.zip -y
move rgthree-comfy-main rgthree-comfy
wget --progress=bar --show-progress https://github.com/nullquant/ComfyUI-BrushNet/archive/refs/heads/main.zip -O main6.zip
7z x main6.zip -y
move ComfyUI-BrushNet-main ComfyUI-BrushNet
cd ComfyUI-BrushNet
..\..\..\python_embeded\python.exe -m pip install -r requirements.txt
cd %custom_nodes_path%
echo ComfyUI-BrushNet模型放置路径:models\inpaint
wget --progress=bar --show-progress https://github.com/cubiq/ComfyUI_InstantID/archive/refs/heads/main.zip -O main11.zip
7z x main11.zip -y
move ComfyUI_InstantID-main ComfyUI_InstantID
echo 根据python.exe版本,安装对应Insightface版本。
cd %ComfyUI_path%
wget --progress=bar --show-progress https://ghp.ci/https://github.com/Gourieff/Assets/raw/refs/heads/main/Insightface/insightface-0.7.3-cp311-cp311-win_amd64.whl -O insightface-0.7.3-cp311-cp311-win_amd64.whl
.\python_embeded\python.exe -m pip install insightface-0.7.3-cp311-cp311-win_amd64.whl
cd %custom_nodes_path%
echo 1、主模型:ComfyUI\models\instantid\ip-adapter.bin
echo 2、insightface模型:ComfyUI\models\insightface\models\antelopev2\1k3d68.onnx、2d106det.onnx、genderage.onnx、glintr100.onnx、scrfd_10g_bnkps.onnx
echo 3、controlnet模型:ComfyUI\models\controlnet\control_instant_id_sdxl.safetensors(模型文件改名以方便后面不同引用进行区分)
wget --progress=bar --show-progress https://github.com/cubiq/ComfyUI_IPAdapter_plus/archive/refs/heads/main.zip -O main12.zip
7z x main12.zip -y
move ComfyUI_IPAdapter_plus-main ComfyUI_IPAdapter_plus
wget --progress=bar --show-progress https://github.com/kijai/ComfyUI-KJNodes/archive/refs/heads/main.zip -O main13.zip
7z x main13.zip -y
move ComfyUI-KJNodes-main ComfyUI-KJNodes
cd ComfyUI-KJNodes
..\..\..\python_embeded\python.exe -m pip install -r requirements.txt
cd %custom_nodes_path%
wget --progress=bar --show-progress https://github.com/AlekPet/ComfyUI_Custom_Nodes_AlekPet/archive/refs/heads/master.zip -O main14.zip
7z x main14.zip -y
move ComfyUI_Custom_Nodes_AlekPet-master ComfyUI_Custom_Nodes_AlekPet
wget --progress=bar --show-progress https://github.com/WASasquatch/was-node-suite-comfyui/archive/refs/heads/main.zip -O main22.zip
7z x main22.zip -y
Move was-node-suite-comfyui-main was-node-suite-comfyui
cd was-node-suite-comfyui
..\..\..\python_embeded\python.exe -m pip install -r requirements.txt
cd %custom_nodes_path%
wget --progress=bar --show-progress https://github.com/nicofdga/DZ-FaceDetailer/archive/refs/heads/main.zip -O main38.zip
7z x main38.zip -y
Move DZ-FaceDetailer-main DZ-FaceDetailer
cd DZ-FaceDetailer
..\..\..\python_embeded\python.exe -s -m pip install -r requirements.txt
wget --progress=bar --show-progress https://github.com/cubiq/ComfyUI_FaceAnalysis/archive/refs/heads/main.zip -O main40.zip
7z x main40.zip -y
Move ComfyUI_FaceAnalysis-main ComfyUI_FaceAnalysis
echo 安装结束
pause
echo on
加入 -O参数 ,指定不会重复的文件名后,安装成功9个,失败1个,失败这个是因为节点不是main分支,而是master分支,URL地址错误导致。
启动ComfyUI后,所有需要执行python.exe -m pip install -r requirements.txt的节点都导入失败,看来还是需要在命令行执行python.exe -m pip install -r requirements.txt。
节点与路径名相关,路径名多了 -main 会发生错误,重命名去掉 -main有必要:
5、节点路径名不去掉 -main 时,在ComfyUI-Manager 中,不能显示为已经安装,但不影响使用:
节点 ComfyUI_InstantID显示未安装:
节点 ComfyUI_InstantID使用没有问题:
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)