sillytavern 1.10.1 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/Launcher.bat +0 -641
package/package.json
CHANGED
package/Launcher.bat
DELETED
|
@@ -1,641 +0,0 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
REM --------------------------------------------
|
|
3
|
-
REM This script was created by: Deffcolony
|
|
4
|
-
REM --------------------------------------------
|
|
5
|
-
title SillyTavern Launcher
|
|
6
|
-
setlocal
|
|
7
|
-
|
|
8
|
-
REM ANSI Escape Code for Colors
|
|
9
|
-
set "reset=[0m"
|
|
10
|
-
|
|
11
|
-
REM Strong Foreground Colors
|
|
12
|
-
set "white_fg_strong=[90m"
|
|
13
|
-
set "red_fg_strong=[91m"
|
|
14
|
-
set "green_fg_strong=[92m"
|
|
15
|
-
set "yellow_fg_strong=[93m"
|
|
16
|
-
set "blue_fg_strong=[94m"
|
|
17
|
-
set "magenta_fg_strong=[95m"
|
|
18
|
-
set "cyan_fg_strong=[96m"
|
|
19
|
-
|
|
20
|
-
REM Normal Background Colors
|
|
21
|
-
set "red_bg=[41m"
|
|
22
|
-
set "blue_bg=[44m"
|
|
23
|
-
|
|
24
|
-
REM Environment Variables (TOOLBOX 7-Zip)
|
|
25
|
-
set "zip7version=7z2301-x64"
|
|
26
|
-
set "zip7_install_path=%ProgramFiles%\7-Zip"
|
|
27
|
-
set "zip7_download_path=%TEMP%\%zip7version%.exe"
|
|
28
|
-
|
|
29
|
-
REM Environment Variables (TOOLBOX FFmpeg)
|
|
30
|
-
set "ffmpeg_url=https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z"
|
|
31
|
-
set "ffdownload_path=%TEMP%\ffmpeg.7z"
|
|
32
|
-
set "ffextract_path=C:\ffmpeg"
|
|
33
|
-
set "bin_path=%ffextract_path%\bin"
|
|
34
|
-
|
|
35
|
-
REM Environment Variables (TOOLBOX Node.js)
|
|
36
|
-
set "node_installer_path=%temp%\NodejsInstaller.msi"
|
|
37
|
-
|
|
38
|
-
REM Environment Variables (winget)
|
|
39
|
-
set "winget_path=%userprofile%\AppData\Local\Microsoft\WindowsApps"
|
|
40
|
-
|
|
41
|
-
REM Environment Variables (TOOLBOX Install Extras)
|
|
42
|
-
set "miniconda_path=%userprofile%\miniconda"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
REM Check if Winget is installed; if not, then install it
|
|
46
|
-
winget --version > nul 2>&1
|
|
47
|
-
if %errorlevel% neq 0 (
|
|
48
|
-
echo %yellow_fg_strong%[WARN] Winget is not installed on this system.
|
|
49
|
-
echo %blue_fg_strong%[INFO]%reset% Installing Winget...
|
|
50
|
-
bitsadmin /transfer "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe" /download /priority FOREGROUND "https://github.com/microsoft/winget-cli/releases/download/v1.5.2201/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" "%temp%\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
|
|
51
|
-
start "" "%temp%\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
|
|
52
|
-
echo %green_fg_strong%Winget is now installed.%reset%
|
|
53
|
-
) else (
|
|
54
|
-
echo %blue_fg_strong%[INFO] Winget is already installed.%reset%
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
rem Get the current PATH value from the registry
|
|
58
|
-
for /f "tokens=2*" %%A in ('reg query "HKCU\Environment" /v PATH') do set "current_path=%%B"
|
|
59
|
-
|
|
60
|
-
rem Check if the paths are already in the current PATH
|
|
61
|
-
echo %current_path% | find /i "%winget_path%" > nul
|
|
62
|
-
set "ff_path_exists=%errorlevel%"
|
|
63
|
-
|
|
64
|
-
rem Append the new paths to the current PATH only if they don't exist
|
|
65
|
-
if %ff_path_exists% neq 0 (
|
|
66
|
-
set "new_path=%current_path%;%winget_path%"
|
|
67
|
-
|
|
68
|
-
rem Update the PATH value in the registry
|
|
69
|
-
reg add "HKCU\Environment" /v PATH /t REG_EXPAND_SZ /d "%new_path%" /f
|
|
70
|
-
|
|
71
|
-
rem Update the PATH value for the current session
|
|
72
|
-
setx PATH "%new_path%" > nul
|
|
73
|
-
echo %green_fg_strong%winget added to PATH.%reset%
|
|
74
|
-
) else (
|
|
75
|
-
set "new_path=%current_path%"
|
|
76
|
-
echo %blue_fg_strong%[INFO] winget already exists in PATH.%reset%
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
REM Check if Git is installed if not then install git
|
|
81
|
-
git --version > nul 2>&1
|
|
82
|
-
if %errorlevel% neq 0 (
|
|
83
|
-
echo %yellow_fg_strong%[WARN] Git is not installed on this system.%reset%
|
|
84
|
-
echo %blue_fg_strong%[INFO]%reset% Installing Git using Winget...
|
|
85
|
-
winget install -e --id Git.Git
|
|
86
|
-
echo %green_fg_strong%Git is installed. Please restart the Launcher.%reset%
|
|
87
|
-
pause
|
|
88
|
-
exit
|
|
89
|
-
) else (
|
|
90
|
-
echo %blue_fg_strong%[INFO] Git is already installed.%reset%
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
REM Check for updates
|
|
94
|
-
git fetch origin
|
|
95
|
-
|
|
96
|
-
for /f %%i in ('git rev-list HEAD...origin/%current_branch%') do (
|
|
97
|
-
set "update_status=%yellow_fg_strong%Update Available%reset%"
|
|
98
|
-
goto :found_update
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
set "update_status=%green_fg_strong%Up to Date%reset%"
|
|
102
|
-
:found_update
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
REM Home - frontend
|
|
106
|
-
:home
|
|
107
|
-
cls
|
|
108
|
-
echo %blue_fg_strong%/ Home%reset%
|
|
109
|
-
echo -------------------------------------
|
|
110
|
-
echo What would you like to do?
|
|
111
|
-
echo 1. Start SillyTavern
|
|
112
|
-
echo 2. Start SillyTavern + Extras
|
|
113
|
-
echo 3. Update
|
|
114
|
-
echo 4. Backup
|
|
115
|
-
echo 5. Switch branch
|
|
116
|
-
echo 6. Toolbox
|
|
117
|
-
echo 7. Exit
|
|
118
|
-
|
|
119
|
-
REM Get the current Git branch
|
|
120
|
-
for /f %%i in ('git branch --show-current') do set current_branch=%%i
|
|
121
|
-
echo ======== VERSION STATUS =========
|
|
122
|
-
echo SillyTavern branch: %cyan_fg_strong%%current_branch%%reset%
|
|
123
|
-
echo Update Status: %update_status%
|
|
124
|
-
echo =================================
|
|
125
|
-
|
|
126
|
-
set "choice="
|
|
127
|
-
set /p "choice=Choose Your Destiny (default is 1): "
|
|
128
|
-
|
|
129
|
-
REM Default to choice 1 if no input is provided
|
|
130
|
-
if not defined choice set "choice=1"
|
|
131
|
-
|
|
132
|
-
REM Home - backend
|
|
133
|
-
if "%choice%"=="1" (
|
|
134
|
-
call :start
|
|
135
|
-
) else if "%choice%"=="2" (
|
|
136
|
-
call :start_extras
|
|
137
|
-
) else if "%choice%"=="3" (
|
|
138
|
-
call :update
|
|
139
|
-
) else if "%choice%"=="4" (
|
|
140
|
-
call :backup_menu
|
|
141
|
-
) else if "%choice%"=="5" (
|
|
142
|
-
call :switchbrance_menu
|
|
143
|
-
) else if "%choice%"=="6" (
|
|
144
|
-
call :toolbox
|
|
145
|
-
) else if "%choice%"=="7" (
|
|
146
|
-
exit
|
|
147
|
-
) else (
|
|
148
|
-
color 6
|
|
149
|
-
echo WARNING: Invalid number. Please insert a valid number.
|
|
150
|
-
pause
|
|
151
|
-
goto :home
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
:start
|
|
156
|
-
REM Check if Node.js is installed
|
|
157
|
-
node --version > nul 2>&1
|
|
158
|
-
if %errorlevel% neq 0 (
|
|
159
|
-
echo %red_fg_strong%[ERROR] node command not found in PATH%reset%
|
|
160
|
-
echo %red_bg%Please make sure Node.js is installed and added to your PATH.%reset%
|
|
161
|
-
echo %blue_bg%To install Node.js go to Toolbox%reset%
|
|
162
|
-
pause
|
|
163
|
-
goto :home
|
|
164
|
-
)
|
|
165
|
-
echo %blue_fg_strong%[INFO]%reset% A new window has been launched.
|
|
166
|
-
start /wait cmd /c start.bat
|
|
167
|
-
goto :home
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
:start_extras
|
|
171
|
-
REM Run conda activate from the Miniconda installation
|
|
172
|
-
call "%miniconda_path%\Scripts\activate.bat"
|
|
173
|
-
|
|
174
|
-
REM Activate the sillytavernextras environment
|
|
175
|
-
call conda activate sillytavernextras
|
|
176
|
-
|
|
177
|
-
REM Start SillyTavern Extras with desired configurations
|
|
178
|
-
python server.py --coqui-gpu --rvc-save-file --cuda-device=0 --max-content-length=1000 --enable-modules=caption,summarize,classify,rvc,coqui-tts --classification-model=joeddav/distilbert-base-uncased-go-emotions-student --share
|
|
179
|
-
goto :home
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
:update
|
|
183
|
-
echo Updating...
|
|
184
|
-
pushd %~dp0
|
|
185
|
-
REM Check if git is installed
|
|
186
|
-
git --version > nul 2>&1
|
|
187
|
-
if %errorlevel% neq 0 (
|
|
188
|
-
echo %red_fg_strong%[ERROR] git command not found in PATH. Skipping update.%reset%
|
|
189
|
-
echo %red_bg%Please make sure Git is installed and added to your PATH.%reset%
|
|
190
|
-
echo %blue_bg%To install Git go to Toolbox%reset%
|
|
191
|
-
) else (
|
|
192
|
-
call git pull --rebase --autostash
|
|
193
|
-
if %errorlevel% neq 0 (
|
|
194
|
-
REM incase there is still something wrong
|
|
195
|
-
echo There were errors while updating. Please download the latest version manually.
|
|
196
|
-
)
|
|
197
|
-
)
|
|
198
|
-
pause
|
|
199
|
-
goto :home
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
REM Switch Brance - frontend
|
|
203
|
-
:switchbrance_menu
|
|
204
|
-
cls
|
|
205
|
-
echo %blue_fg_strong%/ Home / Switch Branch%reset%
|
|
206
|
-
echo -------------------------------------
|
|
207
|
-
echo What would you like to do?
|
|
208
|
-
echo 1. Switch to Release - SillyTavern
|
|
209
|
-
echo 2. Switch to Staging - SillyTavern
|
|
210
|
-
echo 3. Switch to Main - Extras
|
|
211
|
-
echo 4. Switch to Neo - Extras
|
|
212
|
-
echo 5. Back to Home
|
|
213
|
-
|
|
214
|
-
REM Get the current Git branch
|
|
215
|
-
for /f %%i in ('git branch --show-current') do set current_branch=%%i
|
|
216
|
-
echo ======== VERSION STATUS =========
|
|
217
|
-
echo SillyTavern branch: %cyan_fg_strong%%current_branch%%reset%
|
|
218
|
-
echo Extras branch: %cyan_fg_strong%%current_branch%%reset%
|
|
219
|
-
echo =================================
|
|
220
|
-
set /p brance_choice=Choose Your Destiny:
|
|
221
|
-
|
|
222
|
-
REM Switch Brance - backend
|
|
223
|
-
if "%brance_choice%"=="1" (
|
|
224
|
-
call :switch_release_st
|
|
225
|
-
) else if "%brance_choice%"=="2" (
|
|
226
|
-
call :switch_staging_st
|
|
227
|
-
) else if "%brance_choice%"=="3" (
|
|
228
|
-
call :switch_main_ste
|
|
229
|
-
) else if "%brance_choice%"=="4" (
|
|
230
|
-
call :switch_neo_ste
|
|
231
|
-
) else if "%brance_choice%"=="5" (
|
|
232
|
-
goto :home
|
|
233
|
-
) else (
|
|
234
|
-
color 6
|
|
235
|
-
echo WARNING: Invalid number. Please insert a valid number.
|
|
236
|
-
pause
|
|
237
|
-
goto :switchbrance_menu
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
:switch_release_st
|
|
242
|
-
echo %blue_fg_strong%[INFO]%reset% Switching to release branch...
|
|
243
|
-
git switch release
|
|
244
|
-
pause
|
|
245
|
-
goto :switchbrance_menu
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
:switch_staging_st
|
|
249
|
-
echo %blue_fg_strong%[INFO]%reset% Switching to staging branch...
|
|
250
|
-
git switch staging
|
|
251
|
-
pause
|
|
252
|
-
goto :switchbrance_menu
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
:switch_main_ste
|
|
256
|
-
echo %blue_fg_strong%[INFO]%reset% Switching to main branch...
|
|
257
|
-
cd SillyTavern-extras
|
|
258
|
-
git switch main
|
|
259
|
-
pause
|
|
260
|
-
goto :switchbrance_menu
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
:switch_neo_ste
|
|
264
|
-
echo %blue_fg_strong%[INFO]%reset% Switching to neo branch...
|
|
265
|
-
cd SillyTavern-extras
|
|
266
|
-
git switch neo
|
|
267
|
-
pause
|
|
268
|
-
goto :switchbrance_menu
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
REM Backup - Frontend
|
|
272
|
-
:backup_menu
|
|
273
|
-
REM Check if 7-Zip is installed
|
|
274
|
-
7z > nul 2>&1
|
|
275
|
-
if %errorlevel% neq 0 (
|
|
276
|
-
echo %red_fg_strong%[ERROR] 7z command not found in PATH%reset%
|
|
277
|
-
echo %red_bg%Please make sure 7-Zip is installed and added to your PATH.%reset%
|
|
278
|
-
echo %blue_bg%To install 7-Zip go to Toolbox%reset%
|
|
279
|
-
pause
|
|
280
|
-
goto :home
|
|
281
|
-
)
|
|
282
|
-
cls
|
|
283
|
-
echo %blue_fg_strong%/ Home / Backup%reset%
|
|
284
|
-
echo -------------------------------------
|
|
285
|
-
echo What would you like to do?
|
|
286
|
-
REM color 7
|
|
287
|
-
echo 1. Create Backup
|
|
288
|
-
echo 2. Restore Backup
|
|
289
|
-
echo 3. Back to Home
|
|
290
|
-
|
|
291
|
-
set /p backup_choice=Choose Your Destiny:
|
|
292
|
-
|
|
293
|
-
REM Backup - Backend
|
|
294
|
-
if "%backup_choice%"=="1" (
|
|
295
|
-
call :create_backup
|
|
296
|
-
) else if "%backup_choice%"=="2" (
|
|
297
|
-
call :restore_backup
|
|
298
|
-
) else if "%backup_choice%"=="3" (
|
|
299
|
-
goto :home
|
|
300
|
-
) else (
|
|
301
|
-
color 6
|
|
302
|
-
echo WARNING: Invalid number. Please insert a valid number.
|
|
303
|
-
pause
|
|
304
|
-
goto :backup_menu
|
|
305
|
-
)
|
|
306
|
-
|
|
307
|
-
:create_backup
|
|
308
|
-
REM Create a backup using 7zip
|
|
309
|
-
7z a "backups\backup_.7z" ^
|
|
310
|
-
"public\assets\*" ^
|
|
311
|
-
"public\Backgrounds\*" ^
|
|
312
|
-
"public\Characters\*" ^
|
|
313
|
-
"public\Chats\*" ^
|
|
314
|
-
"public\context\*" ^
|
|
315
|
-
"public\Group chats\*" ^
|
|
316
|
-
"public\Groups\*" ^
|
|
317
|
-
"public\instruct\*" ^
|
|
318
|
-
"public\KoboldAI Settings\*" ^
|
|
319
|
-
"public\movingUI\*" ^
|
|
320
|
-
"public\NovelAI Settings\*" ^
|
|
321
|
-
"public\OpenAI Settings\*" ^
|
|
322
|
-
"public\QuickReplies\*" ^
|
|
323
|
-
"public\TextGen Settings\*" ^
|
|
324
|
-
"public\themes\*" ^
|
|
325
|
-
"public\User Avatars\*" ^
|
|
326
|
-
"public\user\*" ^
|
|
327
|
-
"public\worlds\*" ^
|
|
328
|
-
"public\settings.json" ^
|
|
329
|
-
"secrets.json"
|
|
330
|
-
|
|
331
|
-
REM Get current date and time components
|
|
332
|
-
for /f "tokens=1-3 delims=/- " %%d in ("%date%") do (
|
|
333
|
-
set "day=%%d"
|
|
334
|
-
set "month=%%e"
|
|
335
|
-
set "year=%%f"
|
|
336
|
-
)
|
|
337
|
-
|
|
338
|
-
for /f "tokens=1-2 delims=:." %%h in ("%time%") do (
|
|
339
|
-
set "hour=%%h"
|
|
340
|
-
set "minute=%%i"
|
|
341
|
-
)
|
|
342
|
-
|
|
343
|
-
REM Pad single digits with leading zeros
|
|
344
|
-
setlocal enabledelayedexpansion
|
|
345
|
-
set "day=0!day!"
|
|
346
|
-
set "month=0!month!"
|
|
347
|
-
set "hour=0!hour!"
|
|
348
|
-
set "minute=0!minute!"
|
|
349
|
-
|
|
350
|
-
set "formatted_date=%month:~-2%-%day:~-2%-%year%_%hour:~-2%%minute:~-2%"
|
|
351
|
-
|
|
352
|
-
REM Rename the backup file with the formatted date and time
|
|
353
|
-
rename "backups\backup_.7z" "backup_%formatted_date%.7z"
|
|
354
|
-
|
|
355
|
-
endlocal
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
echo %green_fg_strong%Backup created successfully!%reset%
|
|
359
|
-
pause
|
|
360
|
-
endlocal
|
|
361
|
-
goto :backup_menu
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
:restore_backup
|
|
365
|
-
REM Restore a backup using 7zip
|
|
366
|
-
|
|
367
|
-
echo List of available backups:
|
|
368
|
-
echo =========================
|
|
369
|
-
|
|
370
|
-
setlocal enabledelayedexpansion
|
|
371
|
-
set "backup_count=0"
|
|
372
|
-
|
|
373
|
-
for %%F in ("backups\backup_*.7z") do (
|
|
374
|
-
set /a "backup_count+=1"
|
|
375
|
-
set "backup_files[!backup_count!]=%%~nF"
|
|
376
|
-
echo !backup_count!. %cyan_fg_strong%%%~nF%reset%
|
|
377
|
-
)
|
|
378
|
-
|
|
379
|
-
echo =========================
|
|
380
|
-
set /p "restore_choice=Enter number of backup to restore: "
|
|
381
|
-
|
|
382
|
-
if "%restore_choice%" geq "1" (
|
|
383
|
-
if "%restore_choice%" leq "%backup_count%" (
|
|
384
|
-
set "selected_backup=!backup_files[%restore_choice%]!"
|
|
385
|
-
echo Restoring backup !selected_backup!...
|
|
386
|
-
REM Extract the contents of the "public" folder directly into the existing "public" folder
|
|
387
|
-
7z x "backups\!selected_backup!.7z" -o"temp" -aoa
|
|
388
|
-
xcopy /y /e "temp\public\*" "public\"
|
|
389
|
-
rmdir /s /q "temp"
|
|
390
|
-
echo %green_fg_strong%!selected_backup! restored successfully.%reset%
|
|
391
|
-
) else (
|
|
392
|
-
color 6
|
|
393
|
-
echo WARNING: Invalid backup number. Please insert a valid number.
|
|
394
|
-
)
|
|
395
|
-
) else (
|
|
396
|
-
color 6
|
|
397
|
-
echo WARNING: Invalid number. Please insert a valid number.
|
|
398
|
-
)
|
|
399
|
-
pause
|
|
400
|
-
goto :backup_menu
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
REM Toolbox - Frontend
|
|
404
|
-
:toolbox
|
|
405
|
-
cls
|
|
406
|
-
echo %blue_fg_strong%/ Home / Toolbox%reset%
|
|
407
|
-
echo -------------------------------------
|
|
408
|
-
echo What would you like to do?
|
|
409
|
-
REM color 7
|
|
410
|
-
echo 1. Install 7-Zip
|
|
411
|
-
echo 2. Install FFmpeg
|
|
412
|
-
echo 3. Install Node.js
|
|
413
|
-
echo 4. Edit Environment
|
|
414
|
-
echo 5. Reinstall SillyTavern
|
|
415
|
-
echo 6. Reinstall Extras
|
|
416
|
-
echo 7. Back to Home
|
|
417
|
-
|
|
418
|
-
set /p toolbox_choice=Choose Your Destiny:
|
|
419
|
-
|
|
420
|
-
REM Toolbox - Backend
|
|
421
|
-
if "%toolbox_choice%"=="1" (
|
|
422
|
-
call :install7zip
|
|
423
|
-
) else if "%toolbox_choice%"=="2" (
|
|
424
|
-
call :installffmpeg
|
|
425
|
-
) else if "%toolbox_choice%"=="3" (
|
|
426
|
-
call :installnodejs
|
|
427
|
-
) else if "%toolbox_choice%"=="4" (
|
|
428
|
-
call :editenvironment
|
|
429
|
-
) else if "%toolbox_choice%"=="5" (
|
|
430
|
-
call :reinstallsillytavern
|
|
431
|
-
) else if "%toolbox_choice%"=="6" (
|
|
432
|
-
call :reinstallextras
|
|
433
|
-
) else if "%toolbox_choice%"=="7" (
|
|
434
|
-
goto :home
|
|
435
|
-
) else (
|
|
436
|
-
color 6
|
|
437
|
-
echo WARNING: Invalid number. Please insert a valid number.
|
|
438
|
-
pause
|
|
439
|
-
goto :toolbox
|
|
440
|
-
)
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
:install7zip
|
|
444
|
-
echo %blue_fg_strong%[INFO]%reset% Installing 7-Zip...
|
|
445
|
-
winget install -e --id 7zip.7zip
|
|
446
|
-
|
|
447
|
-
rem Get the current PATH value from the registry
|
|
448
|
-
for /f "tokens=2*" %%A in ('reg query "HKCU\Environment" /v PATH') do set "current_path=%%B"
|
|
449
|
-
|
|
450
|
-
rem Check if the paths are already in the current PATH
|
|
451
|
-
echo %current_path% | find /i "%zip7_install_path%" > nul
|
|
452
|
-
set "zip7_path_exists=%errorlevel%"
|
|
453
|
-
|
|
454
|
-
rem Append the new paths to the current PATH only if they don't exist
|
|
455
|
-
if %zip7_path_exists% neq 0 (
|
|
456
|
-
set "new_path=%current_path%;%zip7_install_path%"
|
|
457
|
-
echo %green_fg_strong%7-Zip added to PATH.%reset%
|
|
458
|
-
) else (
|
|
459
|
-
set "new_path=%current_path%"
|
|
460
|
-
echo %blue_fg_strong%[INFO] 7-Zip already exists in PATH.%reset%
|
|
461
|
-
)
|
|
462
|
-
|
|
463
|
-
rem Update the PATH value in the registry
|
|
464
|
-
reg add "HKCU\Environment" /v PATH /t REG_EXPAND_SZ /d "%new_path%" /f
|
|
465
|
-
|
|
466
|
-
rem Update the PATH value for the current session
|
|
467
|
-
setx PATH "%new_path%"
|
|
468
|
-
|
|
469
|
-
echo %green_fg_strong%7-Zip is installed. Please restart the Launcher.%reset%
|
|
470
|
-
pause
|
|
471
|
-
exit
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
:installffmpeg
|
|
475
|
-
REM Check if 7-Zip is installed
|
|
476
|
-
7z > nul 2>&1
|
|
477
|
-
if %errorlevel% neq 0 (
|
|
478
|
-
echo %red_fg_strong%[ERROR] 7z command not found in PATH%reset%
|
|
479
|
-
echo %red_bg%Please make sure 7-Zip is installed and added to your PATH.%reset%
|
|
480
|
-
echo %blue_bg%To install 7-Zip go to Toolbox%reset%
|
|
481
|
-
pause
|
|
482
|
-
goto :toolbox
|
|
483
|
-
)
|
|
484
|
-
|
|
485
|
-
echo %blue_fg_strong%[INFO]%reset% Downloading FFmpeg archive...
|
|
486
|
-
rem bitsadmin /transfer "ffmpeg" /download /priority FOREGROUND "%ffmpeg_url%" "%ffdownload_path%"
|
|
487
|
-
curl -o "%ffdownload_path%" "%ffmpeg_url%"
|
|
488
|
-
|
|
489
|
-
echo %blue_fg_strong%[INFO]%reset% Creating ffmpeg directory if it doesn't exist...
|
|
490
|
-
if not exist "%ffextract_path%" (
|
|
491
|
-
mkdir "%ffextract_path%"
|
|
492
|
-
)
|
|
493
|
-
|
|
494
|
-
echo %blue_fg_strong%[INFO]%reset% Extracting FFmpeg archive...
|
|
495
|
-
7z x "%ffdownload_path%" -o"%ffextract_path%"
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
echo %blue_fg_strong%[INFO]%reset% Moving FFmpeg contents to C:\ffmpeg...
|
|
499
|
-
for /d %%i in ("%ffextract_path%\ffmpeg-*-full_build") do (
|
|
500
|
-
xcopy "%%i\bin" "%ffextract_path%\bin" /E /I /Y
|
|
501
|
-
xcopy "%%i\doc" "%ffextract_path%\doc" /E /I /Y
|
|
502
|
-
xcopy "%%i\presets" "%ffextract_path%\presets" /E /I /Y
|
|
503
|
-
rd "%%i" /S /Q
|
|
504
|
-
)
|
|
505
|
-
|
|
506
|
-
rem Get the current PATH value from the registry
|
|
507
|
-
for /f "tokens=2*" %%A in ('reg query "HKCU\Environment" /v PATH') do set "current_path=%%B"
|
|
508
|
-
|
|
509
|
-
rem Check if the paths are already in the current PATH
|
|
510
|
-
echo %current_path% | find /i "%bin_path%" > nul
|
|
511
|
-
set "ff_path_exists=%errorlevel%"
|
|
512
|
-
|
|
513
|
-
rem Append the new paths to the current PATH only if they don't exist
|
|
514
|
-
if %ff_path_exists% neq 0 (
|
|
515
|
-
set "new_path=%current_path%;%bin_path%"
|
|
516
|
-
echo %green_fg_strong%ffmpeg added to PATH.%reset%
|
|
517
|
-
) else (
|
|
518
|
-
set "new_path=%current_path%"
|
|
519
|
-
echo %blue_fg_strong%[INFO] ffmpeg already exists in PATH.%reset%
|
|
520
|
-
)
|
|
521
|
-
|
|
522
|
-
rem Update the PATH value in the registry
|
|
523
|
-
reg add "HKCU\Environment" /v PATH /t REG_EXPAND_SZ /d "%new_path%" /f
|
|
524
|
-
|
|
525
|
-
rem Update the PATH value for the current session
|
|
526
|
-
setx PATH "%new_path%" > nul
|
|
527
|
-
|
|
528
|
-
del "%ffdownload_path%"
|
|
529
|
-
echo %green_fg_strong%FFmpeg is installed. Please restart the Launcher.%reset%
|
|
530
|
-
pause
|
|
531
|
-
exit
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
:installnodejs
|
|
535
|
-
echo %blue_fg_strong%[INFO]%reset% Installing Node.js...
|
|
536
|
-
winget install -e --id OpenJS.NodeJS
|
|
537
|
-
echo %green_fg_strong%Node.js is installed. Please restart the Launcher.%reset%
|
|
538
|
-
pause
|
|
539
|
-
exit
|
|
540
|
-
|
|
541
|
-
:editenvironment
|
|
542
|
-
rundll32.exe sysdm.cpl,EditEnvironmentVariables
|
|
543
|
-
goto :toolbox
|
|
544
|
-
|
|
545
|
-
:reinstallsillytavern
|
|
546
|
-
setlocal enabledelayedexpansion
|
|
547
|
-
chcp 65001 > nul
|
|
548
|
-
REM Define the names of items to be excluded
|
|
549
|
-
set "script_name=%~nx0"
|
|
550
|
-
set "excluded_folders=backups"
|
|
551
|
-
set "excluded_files=!script_name!"
|
|
552
|
-
|
|
553
|
-
REM Confirm with the user before proceeding
|
|
554
|
-
echo.
|
|
555
|
-
echo %red_bg%╔════ DANGER ZONE ══════════════════════════════════════════════════════════════════════════════╗%reset%
|
|
556
|
-
echo %red_bg%║ WARNING: This will delete all data in the current branch except the Backups. ║%reset%
|
|
557
|
-
echo %red_bg%║ If you want to keep any data, make sure to create a backup before proceeding. ║%reset%
|
|
558
|
-
echo %red_bg%╚═══════════════════════════════════════════════════════════════════════════════════════════════╝%reset%
|
|
559
|
-
echo.
|
|
560
|
-
echo Are you sure you want to proceed? [Y/N]
|
|
561
|
-
set /p "confirmation="
|
|
562
|
-
if /i "!confirmation!"=="Y" (
|
|
563
|
-
REM Remove non-excluded folders
|
|
564
|
-
for /d %%D in (*) do (
|
|
565
|
-
set "exclude_folder="
|
|
566
|
-
for %%E in (!excluded_folders!) do (
|
|
567
|
-
if "%%D"=="%%E" set "exclude_folder=true"
|
|
568
|
-
)
|
|
569
|
-
if not defined exclude_folder (
|
|
570
|
-
rmdir /s /q "%%D" 2>nul
|
|
571
|
-
)
|
|
572
|
-
)
|
|
573
|
-
|
|
574
|
-
REM Remove non-excluded files
|
|
575
|
-
for %%F in (*) do (
|
|
576
|
-
set "exclude_file="
|
|
577
|
-
for %%E in (!excluded_files!) do (
|
|
578
|
-
if "%%F"=="%%E" set "exclude_file=true"
|
|
579
|
-
)
|
|
580
|
-
if not defined exclude_file (
|
|
581
|
-
del /f /q "%%F" 2>nul
|
|
582
|
-
)
|
|
583
|
-
)
|
|
584
|
-
|
|
585
|
-
REM Clone repo into %temp% folder
|
|
586
|
-
git clone https://github.com/SillyTavern/SillyTavern.git "%temp%\SillyTavernTemp"
|
|
587
|
-
|
|
588
|
-
REM Move the contents of the temporary folder to the current directory
|
|
589
|
-
xcopy /e /y "%temp%\SillyTavernTemp\*" .
|
|
590
|
-
|
|
591
|
-
REM Clean up the temporary folder
|
|
592
|
-
rmdir /s /q "%temp%\SillyTavernTemp"
|
|
593
|
-
|
|
594
|
-
echo %green_fg_strong%SillyTavern reinstalled successfully!%reset%
|
|
595
|
-
) else (
|
|
596
|
-
echo Reinstall canceled.
|
|
597
|
-
)
|
|
598
|
-
endlocal
|
|
599
|
-
pause
|
|
600
|
-
goto :toolbox
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
:reinstallextras
|
|
604
|
-
cls
|
|
605
|
-
echo %blue_fg_strong%SillyTavern Extras%reset%
|
|
606
|
-
echo ---------------------------------------------------------------
|
|
607
|
-
echo %blue_fg_strong%[INFO]%reset% Installing SillyTavern Extras...
|
|
608
|
-
echo --------------------------------
|
|
609
|
-
echo %cyan_fg_strong%This may take a while. Please be patient.%reset%
|
|
610
|
-
|
|
611
|
-
winget install -e --id Anaconda.Miniconda3
|
|
612
|
-
|
|
613
|
-
REM Run conda activate from the Miniconda installation
|
|
614
|
-
call "%miniconda_path%\Scripts\activate.bat"
|
|
615
|
-
|
|
616
|
-
REM Create a Conda environment named sillytavernextras
|
|
617
|
-
call conda create -n sillytavernextras -y
|
|
618
|
-
|
|
619
|
-
REM Activate the sillytavernextras environment
|
|
620
|
-
call conda activate sillytavernextras
|
|
621
|
-
|
|
622
|
-
REM Install Python 3.11 and Git in the sillytavernextras environment
|
|
623
|
-
call conda install python=3.11 git -y
|
|
624
|
-
|
|
625
|
-
REM Clone the SillyTavern Extras repository
|
|
626
|
-
git clone https://github.com/SillyTavern/SillyTavern-extras
|
|
627
|
-
|
|
628
|
-
REM Navigate to the SillyTavern-extras directory
|
|
629
|
-
cd SillyTavern-extras
|
|
630
|
-
|
|
631
|
-
REM Install Python dependencies from requirements files
|
|
632
|
-
pip install -r requirements-complete.txt
|
|
633
|
-
pip install -r requirements-rvc.txt
|
|
634
|
-
|
|
635
|
-
REM Start SillyTavern Extras with desired configurations
|
|
636
|
-
python server.py --coqui-gpu --rvc-save-file --cuda-device=0 --max-content-length=1000 --enable-modules=caption,summarize,classify,rvc,coqui-tts --classification-model=joeddav/distilbert-base-uncased-go-emotions-student --share
|
|
637
|
-
|
|
638
|
-
echo.
|
|
639
|
-
echo %green_fg_strong%SillyTavern Extras have been successfully installed.%reset%
|
|
640
|
-
pause
|
|
641
|
-
goto :toolbox
|