ComfyUI中用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包并解压,安装节点)

echo 安装到磁盘,只需要修改下面变量set install_driver=C:即可安装到不同的磁盘中
set install_driver=C:
echo wget路径
set wget_path=D:\GreenSoft\wget

set path=C:\Program Files\7-Zip;%path%;%wget_path%

%install_driver%
cd \

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 path=%path%;%install_driver%\ComfyUI_windows_portable\python_embeded\Scripts
set custom_nodes_path=\ComfyUI_windows_portable\ComfyUI\custom_nodes
Set ComfyUI_path=\ComfyUI_windows_portable

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终止运行

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/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/cubiq/ComfyUI_FaceAnalysis/archive/refs/heads/main.zip  -O main40.zip
7z x main40.zip -y
Move ComfyUI_FaceAnalysis-main  ComfyUI_FaceAnalysis

echo 安装结束
pause

 加入  -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使用没有问题:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值