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参数 ,指定不会重复的文件名保存。
这是我安装节点的一个批处理:
echo 设置自定义节点安装路径变量
set path=D:\GreenSoft\wget;C:\Program Files\7-Zip;%path%
set custom_nodes_path=C:\ComfyUI_windows_portable\ComfyUI\custom_nodes
Set ComfyUI_path=C:\ComfyUI_windows_portable
echo 请确认路径是正确的再继续,否则请按 ctrl+c 中断
pauserem wget --progress=bar --show-progress https://github.com/ltdrdata/ComfyUI-Manager/archive/refs/heads/main.zip -O main1.zip
rem 7z x main1.zip -y
rem move ComfyUI-Manager-main ComfyUI-Manager
rem echo 语言包安装
rem wget --progress=bar --show-progress https://github.com/AIGODLIKE/AIGODLIKE-COMFYUI-TRANSLATION/archive/refs/heads/main.zip -O main2.zip
rem 7z x main2.zip -y
rem move AIGODLIKE-COMFYUI-TRANSLATION-main AIGODLIKE-COMFYUI-TRANSLATIONecho 好像安装ComfyUI-Crystools会有不少运行时错误,不过不影响
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.txtcd %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-comfywget --progress=bar --show-progress https://github.com/chrisgoringe/cg-use-everywhere/archive/refs/heads/main.zip -O main5.zip
7z x main5.zip -y
move cg-use-everywhere-main cg-use-everywherewget --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.txtcd %custom_nodes_path%
wget --progress=bar --show-progress https://github.com/NimaNzrii/comfyui-photoshop/archive/refs/heads/main.zip -O main7.zip
7z x main7.zip -y
move comfyui-photoshop-main comfyui-photoshopwget --progress=bar --show-progress https://github.com/alpertunga-bile/image-caption-comfyui/archive/refs/heads/master.zip -O main8.zip
7z x main8.zip -y
move image-caption-comfyui-master image-caption-comfyuiwget --progress=bar --show-progress https://github.com/pythongosssss/ComfyUI-Custom-Scripts/archive/refs/heads/main.zip -O main9.zip
7z x main9.zip -y
move ComfyUI-Custom-Scripts-main ComfyUI-Custom-Scriptswget --progress=bar --show-progress https://github.com/Acly/comfyui-inpaint-nodes/archive/refs/heads/main.zip -O main10.zip
7z x main10.zip -y
move comfyui-inpaint-nodes-main comfyui-inpaint-nodeswget --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_InstantIDecho 根据python.exe版本,安装对应insightface版本。请确认安装文件nstall insightface-0.7.3-cp311-cp311-win_amd64.whl在当前路径下
rem pausecd %ComfyUI_path%.\python_embeded\python.exe -m pip install insightface-0.7.3-cp311-cp311-win_amd64.whl .\python_embeded\python.exe -m pip install onnxruntime-gpu onnxruntime cd %custom_nodes_path%
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_pluswget --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.txtcd %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_AlekPetrem flux节点
wget --progress=bar --show-progress https://github.com/city96/ComfyUI-GGUF/archive/refs/heads/main.zip -O main15.zip
7z x main15.zip -y
move ComfyUI-GGUF-main ComfyUI-GGUF
cd ComfyUI-GGUF-main
..\..\..\python_embeded\python.exe -m pip install -r requirements.txtcd %custom_nodes_path%
rem wget --progress=bar --show-progress https://github.com/MrForExample/ComfyUI-AnimateAnyone-Evolved/archive/refs/heads/main.zip -O main16.zip
rem 7z x main16.zip -y
rem move ComfyUI-AnimateAnyone-Evolved-main ComfyUI-AnimateAnyone-Evolved
rem cd ComfyUI-AnimateAnyone-Evolved-mainrem ..\..\..\python_embeded\python.exe -m pip install -r requirements.txtcd %custom_nodes_path%
wget --progress=bar --show-progress https://github.com/kijai/ComfyUI-LivePortraitKJ/archive/refs/heads/main.zip -O main17.zip
7z x main17.zip -y
move ComfyUI-LivePortraitKJ-main ComfyUI-LivePortraitKJwget --progress=bar --show-progress https://github.com/cubiq/ComfyUI_essentials/archive/refs/heads/main.zip -O main18.zip
7z x main18.zip -y
move ComfyUI_essentials-main ComfyUI_essentialswget --progress=bar --show-progress https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite/archive/refs/heads/main.zip -O main19.zip
7z x main19.zip -y
move ComfyUI-VideoHelperSuite-main ComfyUI-VideoHelperSuite
cd %ComfyUI_path%
.\python_embeded\python.exe -m pip install imageio-ffmpegecho 安装结束
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使用没有问题:
6、昨晚试了用上面的批处理安装19个节点, 除了ComfyUI-LivePortraitKJ module for custom nodes: No module named 'pykalman'与ComfyUI-GGUF module for custom nodes: No module named 'gguf'这2个节点需要再安装所需模块外,其他17个节点一次过成功。