@ECHO OFF
|
|
set startdir=%cd%
|
set vcpkg_root_dir=%startdir%\vcpkg
|
set src_dir=%startdir%\src
|
set compiled_dir=%startdir%\ready
|
set installers_dir=%startdir%\installers
|
set basedirname=%src_dir%\sd.cpp.gui.wx
|
set avx_dir=%basedirname%_avx
|
set avx2_dir=%basedirname%_avx2
|
set avx512_dir=%basedirname%_avx512
|
set CUDA_dir=%basedirname%_CUDA
|
set ISCC="C:\Program Files (x86)\Inno Setup 6\iscc.exe"
|
|
:start
|
@ECHO OFF
|
cls
|
@ECHO Select job:
|
@echo:
|
@echo 0: Install vcpkg
|
@echo 1: force clone
|
@echo 2: build all
|
@echo 3: copy to place
|
@echo 4: create installers
|
@echo --------------
|
@echo 5: exit
|
|
set /p "id=Choose one: "
|
|
if %id%==0 goto VCPKG
|
if %id%==1 goto GITPULL
|
if %id%==2 goto BUILD
|
if %id%==3 goto COPY
|
if %id%==5 goto done
|
if %id%==4 goto INNO
|
|
|
:INNO
|
IF NOT EXIST %installers_dir%\ (
|
mkdir %installers_dir%
|
)
|
|
REM A fájl elérési útvonala
|
set "version_file=src\sd.cpp.gui.wx_avx\ui\ver.hpp"
|
|
|
for /f tokens^=2^ delims^=^" %%a in ('type %version_file% ^| findstr /c:"SD_GUI_VERSION"') do (
|
set "SD_GUI_VERSION=%%~a"
|
)
|
|
set SD_GUI_VARIATION=avx
|
set SD_GUI_VERSION=%SD_GUI_VERSION%
|
echo SD GUI version: %SD_GUI_VERSION%
|
echo SD GUI variation: %SD_GUI_VARIATION%
|
|
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I
|
set date=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%
|
|
|
%ISCC% /O"%installers_dir%/%date%" sd.gui.wx.iss
|
|
set SD_GUI_VARIATION=avx2
|
set SD_GUI_VERSION=%SD_GUI_VERSION%
|
echo SD GUI version: %SD_GUI_VERSION%
|
echo SD GUI variation: %SD_GUI_VARIATION%
|
|
%ISCC% /O"%installers_dir%/%date%" sd.gui.wx.iss
|
|
|
set SD_GUI_VARIATION=avx512
|
set SD_GUI_VERSION=%SD_GUI_VERSION%
|
echo SD GUI version: %SD_GUI_VERSION%
|
echo SD GUI variation: %SD_GUI_VARIATION%
|
|
%ISCC% /O"%installers_dir%/%date%" sd.gui.wx.iss
|
|
set SD_GUI_VARIATION=cuda
|
set SD_GUI_VERSION=%SD_GUI_VERSION%
|
echo SD GUI version: %SD_GUI_VERSION%
|
echo SD GUI variation: %SD_GUI_VARIATION%
|
|
%ISCC% /O"%installers_dir%/%date%" sd.gui.wx.iss
|
|
REM %ISCC% /O"%installers_dir%/%date%" sd.gui.wx_avx2.iss
|
REM %ISCC% /O"%installers_dir%/%date%" sd.gui.wx_avx512.iss
|
REM %ISCC% /O"%installers_dir%/%date%" sd.gui.wx_avx_CUDA.iss
|
|
pause
|
goto start
|
|
|
:VCPKG
|
cls
|
IF NOT EXIST "%vcpkg_root_dir%"\ (
|
git clone https://github.com/microsoft/vcpkg.git %vcpkg_root_dir%
|
) ELSE (
|
set /p DUMMY=Already installed... hit ENTER to continue...
|
)
|
goto start
|
|
:GITPULL
|
cls
|
REM Pulling all git...
|
if exist %avx_dir%\ (
|
rmdir /s /q %avx_dir%
|
)
|
|
git clone https://github.com/fszontagh/sd.cpp.gui.wx.git %avx_dir%
|
|
if exist %avx2_dir%\ (
|
rmdir /s /q %avx2_dir%
|
)
|
|
git clone https://github.com/fszontagh/sd.cpp.gui.wx.git %avx2_dir%
|
|
if exist %avx512_dir%\ (
|
rmdir /s /q %avx512_dir%
|
)
|
|
git clone https://github.com/fszontagh/sd.cpp.gui.wx.git %avx512_dir%
|
|
|
if exist %CUDA_dir%\ (
|
rmdir /s /q %CUDA_dir%
|
)
|
|
git clone https://github.com/fszontagh/sd.cpp.gui.wx.git %CUDA_dir%
|
|
cd %avx_dir%
|
git fetch --all
|
git reset --hard origin/main
|
git pull
|
cd %avx2_dir%
|
git fetch --all
|
git reset --hard origin/main
|
git pull
|
cd %avx512_dir%
|
git fetch --all
|
git reset --hard origin/main
|
git pull
|
cd %CUDA_dir%
|
git fetch --all
|
git reset --hard origin/main
|
git pull
|
cd %startdir%
|
goto :start
|
|
:BUILD
|
cls
|
cd %avx_dir%
|
powershell -Command "(gc vcpkg.json) -replace '\"cuda\"\,', '' | Out-File -encoding ASCII vcpkg.json"
|
IF EXIST external\stable-diffusion\ (
|
rmdir /s /q external\stable-diffusion
|
)
|
IF EXIST build\ (
|
rmdir /s /q build
|
)
|
cmake -B build/ -S . -DCMAKE_TOOLCHAIN_FILE=%vcpkg_root_dir%/scripts/buildsystems/vcpkg.cmake -DGGML_AVX512=OFF -DGGML_AVX2=OFF -DGGML_AVX=ON -DSD_CUBLAS=OFF
|
cmake --build build/ --config Release
|
cd %startdir%
|
|
cd %avx2_dir%
|
powershell -Command "(gc vcpkg.json) -replace '\"cuda\"\,', '' | Out-File -encoding ASCII vcpkg.json"
|
rmdir /s /q external\stable-diffusion
|
rmdir /s /q build
|
cmake -B build/ -S . -DCMAKE_TOOLCHAIN_FILE=%vcpkg_root_dir%/scripts/buildsystems/vcpkg.cmake -DGGML_AVX512=OFF -DGGML_AVX2=ON -DGGML_AVX=OFF -DSD_CUBLAS=OFF
|
cmake --build build/ --config Release
|
cd %startdir%
|
|
|
cd %avx512_dir%
|
powershell -Command "(gc vcpkg.json) -replace '\"cuda\"\,', '' | Out-File -encoding ASCII vcpkg.json"
|
IF EXIST external\stable-diffusion\ (
|
rmdir /s /q external\stable-diffusion
|
)
|
IF EXIST build\ (
|
rmdir /s /q build
|
)
|
cmake -B build/ -S . -DCMAKE_TOOLCHAIN_FILE=%vcpkg_root_dir%/scripts/buildsystems/vcpkg.cmake -DGGML_AVX512=ON -DGGML_AVX2=ON -DGGML_AVX=ON -DSD_CUBLAS=OFF
|
cmake --build build/ --config Release
|
cd %startdir%
|
|
cd %CUDA_dir%
|
IF EXIST external\stable-diffusion\ (
|
rmdir /s /q external\stable-diffusion
|
)
|
IF EXIST build\ (
|
rmdir /s /q build
|
)
|
cmake -B build/ -S . -DCMAKE_TOOLCHAIN_FILE=%vcpkg_root_dir%/scripts/buildsystems/vcpkg.cmake -DSD_CUBLAS=ON
|
cmake --build build/ --config Release
|
cd %startdir%
|
|
goto :start
|
|
:COPY
|
cls
|
IF NOT EXIST %compiled_dir%\ (
|
mkdir %compiled_dir%
|
)
|
IF NOT EXIST %compiled_dir%\sd.cpp.gui.wx_avx\ (
|
mkdir %compiled_dir%\sd.cpp.gui.wx_avx
|
)
|
xcopy /s /v /h /y %avx_dir%\build\Release %compiled_dir%\sd.cpp.gui.wx_avx\
|
|
|
IF NOT EXIST %compiled_dir%\sd.cpp.gui.wx_avx2\ (
|
mkdir %compiled_dir%\sd.cpp.gui.wx_avx2
|
)
|
|
xcopy /s /v /h /y %avx2_dir%\build\Release %compiled_dir%\sd.cpp.gui.wx_avx2\
|
|
IF NOT EXIST %compiled_dir%\sd.cpp.gui.wx_avx512\ (
|
mkdir %compiled_dir%\sd.cpp.gui.wx_avx512
|
)
|
xcopy /s /v /h /y %avx512_dir%\build\Release %compiled_dir%\sd.cpp.gui.wx_avx512\
|
|
|
IF NOT EXIST %compiled_dir%\sd.cpp.gui.wx_cuda\ (
|
mkdir %compiled_dir%\sd.cpp.gui.wx_cuda
|
)
|
|
xcopy /s /v /h /y %CUDA_dir%\build\Release %compiled_dir%\sd.cpp.gui.wx_cuda\
|
|
goto :done
|
|
:done
|
cd %startdir%
|
pause >nul
|