File size: 1,228 Bytes
d562b38 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0"
set "target_dir=%~dp0"
set "custom_n=%target_dir%ComfyUI\custom_nodes"
set "PATH=%PATH%;%target_dir%git\git\bin;%target_dir%git\git\libexec;%target_dir%python;%target_dir%\python\Library\bin;%target_dir%python\Scripts"
set "git=%target_dir%git\git\bin\git"
echo Checking and updating repositories in custom_nodes folder...
for /d %%D in ("%custom_n%\*") do (
if exist "%%D\.git" (
echo Updating %%~nxD...
cd "%%D"
%git% fetch
for /f %%i in ('%git% rev-list HEAD...origin/main --count') do set "commits=%%i"
if !commits! neq 0 (
echo %%~nxD is !commits! commits behind. Updating...
%git% pull
echo %%~nxD updated successfully.
) else (
echo %%~nxD is up to date.
)
cd ..
)
)
echo Updating main ComfyUI repository...
cd "%target_dir%ComfyUI"
%git% pull
echo Updating Python packages...
"%target_dir%python\python.exe" -s -m pip install --upgrade torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121 -r "%target_dir%ComfyUI/requirements.txt" pygit2
echo All updates completed.
pause |