Upload KOHYA SS AUTO INSTALLER.bat
Browse files- KOHYA SS AUTO INSTALLER.bat +70 -0
KOHYA SS AUTO INSTALLER.bat
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@echo off
|
2 |
+
echo Checking and installing necessary software...
|
3 |
+
|
4 |
+
REM Base Directory (can be updated if necessary)
|
5 |
+
set BASE_DIR=.\kohya_ss\
|
6 |
+
|
7 |
+
REM Check and install Python
|
8 |
+
python --version > NUL 2>&1
|
9 |
+
if %errorlevel% NEQ 0 (
|
10 |
+
echo Installing Python 3.10.6...
|
11 |
+
powershell -Command "& {Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe' -OutFile 'python-3.10.6-amd64.exe'}"
|
12 |
+
if %errorlevel% NEQ 0 (
|
13 |
+
echo Failed to download Python installer.
|
14 |
+
exit /b
|
15 |
+
)
|
16 |
+
start /wait python-3.10.6-amd64.exe /quiet InstallAllUsers=1 PrependPath=1
|
17 |
+
del python-3.10.6-amd64.exe
|
18 |
+
) else (
|
19 |
+
echo Python already installed.
|
20 |
+
)
|
21 |
+
|
22 |
+
REM Check and install Git
|
23 |
+
git --version > NUL 2>&1
|
24 |
+
if %errorlevel% NEQ 0 (
|
25 |
+
echo Installing Git...
|
26 |
+
powershell -Command "& {Invoke-WebRequest -Uri 'https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/Git-2.41.0.3-64-bit.exe' -OutFile 'Git-2.41.0.3-64-bit.exe'}"
|
27 |
+
if %errorlevel% NEQ 0 (
|
28 |
+
echo Failed to download Git installer.
|
29 |
+
exit /b
|
30 |
+
)
|
31 |
+
start /wait Git-2.41.0.3-64-bit.exe /VERYSILENT
|
32 |
+
del Git-2.41.0.3-64-bit.exe
|
33 |
+
) else (
|
34 |
+
echo Git already installed.
|
35 |
+
)
|
36 |
+
|
37 |
+
REM Check and install Visual Studio 2015, 2017, 2019, and 2022 redistributable
|
38 |
+
echo Checking for Visual Studio redistributable...
|
39 |
+
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64 /v Version >NUL 2>&1
|
40 |
+
if %errorlevel% NEQ 0 (
|
41 |
+
echo Installing Visual Studio 2015, 2017, 2019, and 2022 redistributable...
|
42 |
+
powershell -Command "& {Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vc_redist.x64.exe' -OutFile 'vc_redist.x64.exe'}"
|
43 |
+
if %errorlevel% NEQ 0 (
|
44 |
+
echo Failed to download Visual Studio redistributable installer.
|
45 |
+
exit /b
|
46 |
+
)
|
47 |
+
start /wait vc_redist.x64.exe /install /quiet /norestart
|
48 |
+
del vc_redist.x64.exe
|
49 |
+
) else (
|
50 |
+
echo Visual Studio redistributable already installed.
|
51 |
+
)
|
52 |
+
|
53 |
+
echo Cloning kohya_ss repository...
|
54 |
+
git clone https://github.com/bmaltais/kohya_ss.git
|
55 |
+
if %errorlevel% NEQ 0 (
|
56 |
+
echo Failed to clone repository.
|
57 |
+
exit /b
|
58 |
+
)
|
59 |
+
|
60 |
+
echo Listing the contents of the cloned repository...
|
61 |
+
dir %BASE_DIR%
|
62 |
+
|
63 |
+
echo Changing directory to the cloned repository...
|
64 |
+
cd %BASE_DIR%
|
65 |
+
|
66 |
+
echo Running setup.bat...
|
67 |
+
call setup.bat
|
68 |
+
|
69 |
+
echo Setup completed successfully!
|
70 |
+
pause
|