|
@echo off |
|
setlocal |
|
chcp 65001 > nul |
|
set target_dir=%~dp0 |
|
set py=%target_dir%python_embeded\ |
|
|
|
call :ColorText "=============================================================" "Yellow" |
|
call :ColorText ".bat file for installing git/python for ComfyUI by Skiffbox" "Green" |
|
|
|
call :ColorText "=============================================================" "Yellow" |
|
%target_dir%wget.exe -c -q -O git.zip https://huggingface.co/iRedHat/iBat-ComfyUI/resolve/main/git.zip |
|
|
|
call :ColorText "Download git.zip" "Green" |
|
set "zipfile=%target_dir%git.zip" |
|
set "dest=%target_dir%git" |
|
echo UnZip git.zip |
|
powershell -command "Expand-Archive -Path '%zipfile%' -DestinationPath '%dest%'" |
|
del /f /q "%target_dir%git.zip" |
|
call :ColorText "Install git complete" "Green" |
|
|
|
set git_path=%target_dir%git\ |
|
set git_bin_path=%git_path%bin |
|
set git_libexec_path=%git_path%libexec |
|
set PATH=%git_path%;%git_bin_path%;%git_libexec_path%;%py%Scripts;%PATH% |
|
|
|
cd %target_dir% |
|
%target_dir%wget.exe -c -q -O python_embeded.zip https://www.python.org/ftp/python/3.11.9/python-3.11.9-embed-amd64.zip |
|
call :ColorText "Download python_embeded.zip" "Green" |
|
set "zipfile1=%target_dir%python_embeded.zip" |
|
set "dest1=%target_dir%python_embeded" |
|
echo UnZip python_embeded.zip |
|
powershell -command "Expand-Archive -Path '%zipfile1%' -DestinationPath '%dest1%'" |
|
del /f /q "%target_dir%python_embeded.zip" |
|
mv %py%python311._pth %py%python311.pth |
|
echo import site>> %py%python311.pth |
|
mkdir %py%DLLs |
|
|
|
%target_dir%wget.exe -c -q -O get-pip.py https://bootstrap.pypa.io/get-pip.py |
|
%py%python.exe get-pip.py |
|
del /f /q "%target_dir%get-pip.py" |
|
%py%python.exe -m pip install virtualenv |
|
|
|
|
|
|
|
|
|
endlocal |
|
exit /b |
|
|
|
:ColorText |
|
setlocal |
|
set text=%~1 |
|
set color=%~2 |
|
powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host '%text%' -ForegroundColor %color%" |
|
exit /b |