launcher upgrades

+fixes removal of xtts-api-folder
+moved xtts editor into voice generation
This commit is contained in:
deffcolony
2024-05-10 13:48:02 +02:00
parent c0b88be416
commit 562fc96fb8
2 changed files with 187 additions and 145 deletions

View File

@@ -2169,6 +2169,7 @@ echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Adding voice example
xcopy "%~dp0voice-generation\xtts-api-server\example\*" "%~dp0voice-generation\xtts\speakers\" /y /e
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Removing the xtts-api-server directory...
cd /d "%~dp0"
rmdir /s /q "%~dp0voice-generation\xtts-api-server"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%XTTS installed successfully%reset%
pause
@@ -3975,8 +3976,9 @@ echo -------------------------------------------------------------
echo What would you like to do?
echo 1. Text Completion
echo 2. Image Generation
echo 3. Core Utilities
echo 2. Voice Generation
echo 3. Image Generation
echo 4. Core Utilities
echo 0. Back
set /p editor_choice=Choose Your Destiny:
@@ -3985,8 +3987,10 @@ REM ################# EDITOR - BACKEND ########################
if "%editor_choice%"=="1" (
call :editor_text_completion
) else if "%editor_choice%"=="2" (
call :editor_image_generation
call :editor_voice_generation
) else if "%editor_choice%"=="3" (
call :editor_image_generation
) else if "%editor_choice%"=="4" (
call :editor_core_utilities
) else if "%editor_choice%"=="0" (
goto :toolbox
@@ -4183,6 +4187,177 @@ pause
goto :editor_text_completion
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ############################################################
REM ######## EDITOR VOICE GENERATION - FRONTEND ################
REM ############################################################
:editor_voice_generation
title STL [EDITOR VOICE GENERATION]
cls
echo %blue_fg_strong%/ Home / Toolbox / Editor / Voice Generation%reset%
echo -------------------------------------------------------------
echo What would you like to do?
echo 1. Edit XTTS Modules
echo 0. Back
set /p editor_voice_gen_choice=Choose Your Destiny:
REM ######## EDITOR VOICE GENERATION - BACKEND #########
if "%editor_voice_gen_choice%"=="1" (
call :edit_xtts_modules
) else if "%editor_voice_gen_choice%"=="0" (
goto :editor
) else (
echo [%DATE% %TIME%] %log_invalidinput% >> %log_path%
echo %red_bg%[%time%]%reset% %echo_invalidinput%
pause
goto :editor_voice_generation
)
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM Function to print module options with color based on their status
:printModule
if "%2"=="true" (
echo %green_fg_strong%%1 [Enabled]%reset%
) else (
echo %red_fg_strong%%1 [Disabled]%reset%
)
exit /b
REM ############################################################
REM ############## EDIT XTTS MODULES - FRONTEND ################
REM ############################################################
:edit_xtts_modules
title STL [EDIT XTTS MODULES]
cls
echo %blue_fg_strong%/ Home / Toolbox / Editor / Edit XTTS Modules%reset%
echo -------------------------------------------------------------
echo Choose XTTS modules to enable or disable (e.g., "1 2 4" to enable Cuda, hs, and cache)
REM Display module options with colors based on their status
call :printModule "1. cuda (--device cuda)" %xtts_cuda_trigger%
call :printModule "2. hs (-hs 0.0.0.0)" %xtts_hs_trigger%
call :printModule "3. deepspeed (--deepspeed)" %xtts_deepspeed_trigger%
call :printModule "4. cache (--use-cache)" %xtts_cache_trigger%
call :printModule "5. listen (--listen)" %xtts_listen_trigger%
call :printModule "6. model (--model-source local)" %xtts_model_trigger%
echo 00. Quick Start XTTS
echo 0. Back
set "python_command="
set /p xtts_module_choices=Choose modules to enable/disable:
REM Handle the user's module choices and construct the Python command
for %%i in (%xtts_module_choices%) do (
if "%%i"=="1" (
if "%xtts_cuda_trigger%"=="true" (
set "xtts_cuda_trigger=false"
) else (
set "xtts_cuda_trigger=true"
)
) else if "%%i"=="2" (
if "%xtts_hs_trigger%"=="true" (
set "xtts_hs_trigger=false"
) else (
set "xtts_hs_trigger=true"
)
) else if "%%i"=="3" (
if "%xtts_deepspeed_trigger%"=="true" (
set "xtts_deepspeed_trigger=false"
) else (
set "xtts_deepspeed_trigger=true"
)
) else if "%%i"=="4" (
if "%xtts_cache_trigger%"=="true" (
set "xtts_cache_trigger=false"
) else (
set "xtts_cache_trigger=true"
)
) else if "%%i"=="5" (
if "%xtts_listen_trigger%"=="true" (
set "xtts_listen_trigger=false"
) else (
set "xtts_listen_trigger=true"
)
) else if "%%i"=="6" (
if "%xtts_model_trigger%"=="true" (
set "xtts_model_trigger=false"
) else (
set "xtts_model_trigger=true"
)
) else if "%%i"=="00" (
goto :start_xtts
) else if "%%i"=="0" (
goto :editor_voice_generation
)
)
REM Save the module flags to modules-xtts
echo xtts_cuda_trigger=%xtts_cuda_trigger%>%xtts_modules_path%
echo xtts_hs_trigger=%xtts_hs_trigger%>>%xtts_modules_path%
echo xtts_deepspeed_trigger=%xtts_deepspeed_trigger%>>%xtts_modules_path%
echo xtts_cache_trigger=%xtts_cache_trigger%>>%xtts_modules_path%
echo xtts_listen_trigger=%xtts_listen_trigger%>>%xtts_modules_path%
echo xtts_model_trigger=%xtts_model_trigger%>>%xtts_modules_path%
REM remove modules_enable
set "modules_enable="
REM Compile the Python command
set "python_command=python -m xtts_api_server"
if "%xtts_cuda_trigger%"=="true" (
set "python_command=%python_command% --device cuda"
)
if "%xtts_hs_trigger%"=="true" (
set "python_command=%python_command% -hs 0.0.0.0"
)
if "%xtts_deepspeed_trigger%"=="true" (
set "python_command=%python_command% --deepspeed"
)
if "%xtts_cache_trigger%"=="true" (
set "python_command=%python_command% --use-cache"
)
if "%xtts_listen_trigger%"=="true" (
set "python_command=%python_command% --listen"
)
if "%xtts_model_trigger%"=="true" (
set "python_command=%python_command% --model-source local"
)
REM is modules_enable empty?
if defined modules_enable (
REM remove last comma
set "modules_enable=%modules_enable:~0,-1%"
)
REM command completed
if defined modules_enable (
set "python_command=%python_command% --enable-modules=%modules_enable%"
)
REM Save the constructed Python command to modules-xtts for testing
echo xtts_start_command=%python_command%>>%xtts_modules_path%
goto :edit_xtts_modules
REM ############################################################
REM ######## EDITOR IMAGE GENERATION - FRONTEND ################
REM ############################################################
@@ -4219,10 +4394,10 @@ if "%editor_img_gen_choice%"=="1" (
goto :editor_image_generation
)
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM Function to print module options with color based on their status
:printModule
@@ -4422,8 +4597,7 @@ echo -------------------------------------------------------------
echo What would you like to do?
echo 1. Edit SillyTavern config.yaml
echo 2. Edit Extras
echo 3. Edit XTTS
echo 4. Edit Environment Variables
echo 3. Edit Environment Variables
echo 0. Back
set /p editor_core_util_choice=Choose Your Destiny:
@@ -4434,8 +4608,6 @@ if "%editor_core_util_choice%"=="1" (
) else if "%editor_core_util_choice%"=="2" (
call :edit_extras_modules
) else if "%editor_core_util_choice%"=="3" (
call :edit_xtts_modules
) else if "%editor_core_util_choice%"=="4" (
call :edit_env_var
) else if "%editor_core_util_choice%"=="0" (
goto :editor
@@ -4450,7 +4622,9 @@ if "%editor_core_util_choice%"=="1" (
start "" "%~dp0SillyTavern\config.yaml"
goto :editor_core_utilities
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM Function to print module options with color based on their status
:printModule
@@ -4622,141 +4796,7 @@ REM Save the constructed Python command to modules-extras for testing
echo extras_start_command=%python_command%>>%extras_modules_path%
goto :edit_extras_modules
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM ##################################################################################################################################################
REM Function to print module options with color based on their status
:printModule
if "%2"=="true" (
echo %green_fg_strong%%1 [Enabled]%reset%
) else (
echo %red_fg_strong%%1 [Disabled]%reset%
)
exit /b
REM ############################################################
REM ############## EDIT XTTS MODULES - FRONTEND ################
REM ############################################################
:edit_xtts_modules
title STL [EDIT XTTS MODULES]
cls
echo %blue_fg_strong%/ Home / Toolbox / Editor / Edit XTTS Modules%reset%
echo -------------------------------------------------------------
echo Choose XTTS modules to enable or disable (e.g., "1 2 4" to enable Cuda, hs, and cache)
REM Display module options with colors based on their status
call :printModule "1. cuda (--device cuda)" %xtts_cuda_trigger%
call :printModule "2. hs (-hs 0.0.0.0)" %xtts_hs_trigger%
call :printModule "3. deepspeed (--deepspeed)" %xtts_deepspeed_trigger%
call :printModule "4. cache (--use-cache)" %xtts_cache_trigger%
call :printModule "5. listen (--listen)" %xtts_listen_trigger%
call :printModule "6. model (--model-source local)" %xtts_model_trigger%
echo 00. Quick Start XTTS
echo 0. Back
set "python_command="
set /p xtts_module_choices=Choose modules to enable/disable:
REM Handle the user's module choices and construct the Python command
for %%i in (%xtts_module_choices%) do (
if "%%i"=="1" (
if "%xtts_cuda_trigger%"=="true" (
set "xtts_cuda_trigger=false"
) else (
set "xtts_cuda_trigger=true"
)
) else if "%%i"=="2" (
if "%xtts_hs_trigger%"=="true" (
set "xtts_hs_trigger=false"
) else (
set "xtts_hs_trigger=true"
)
) else if "%%i"=="3" (
if "%xtts_deepspeed_trigger%"=="true" (
set "xtts_deepspeed_trigger=false"
) else (
set "xtts_deepspeed_trigger=true"
)
) else if "%%i"=="4" (
if "%xtts_cache_trigger%"=="true" (
set "xtts_cache_trigger=false"
) else (
set "xtts_cache_trigger=true"
)
) else if "%%i"=="5" (
if "%xtts_listen_trigger%"=="true" (
set "xtts_listen_trigger=false"
) else (
set "xtts_listen_trigger=true"
)
) else if "%%i"=="6" (
if "%xtts_model_trigger%"=="true" (
set "xtts_model_trigger=false"
) else (
set "xtts_model_trigger=true"
)
) else if "%%i"=="00" (
goto :start_xtts
) else if "%%i"=="0" (
goto :editor_core_utilities
)
)
REM Save the module flags to modules-xtts
echo xtts_cuda_trigger=%xtts_cuda_trigger%>%xtts_modules_path%
echo xtts_hs_trigger=%xtts_hs_trigger%>>%xtts_modules_path%
echo xtts_deepspeed_trigger=%xtts_deepspeed_trigger%>>%xtts_modules_path%
echo xtts_cache_trigger=%xtts_cache_trigger%>>%xtts_modules_path%
echo xtts_listen_trigger=%xtts_listen_trigger%>>%xtts_modules_path%
echo xtts_model_trigger=%xtts_model_trigger%>>%xtts_modules_path%
REM remove modules_enable
set "modules_enable="
REM Compile the Python command
set "python_command=python -m xtts_api_server"
if "%xtts_cuda_trigger%"=="true" (
set "python_command=%python_command% --device cuda"
)
if "%xtts_hs_trigger%"=="true" (
set "python_command=%python_command% -hs 0.0.0.0"
)
if "%xtts_deepspeed_trigger%"=="true" (
set "python_command=%python_command% --deepspeed"
)
if "%xtts_cache_trigger%"=="true" (
set "python_command=%python_command% --use-cache"
)
if "%xtts_listen_trigger%"=="true" (
set "python_command=%python_command% --listen"
)
if "%xtts_model_trigger%"=="true" (
set "python_command=%python_command% --model-source local"
)
REM is modules_enable empty?
if defined modules_enable (
REM remove last comma
set "modules_enable=%modules_enable:~0,-1%"
)
REM command completed
if defined modules_enable (
set "python_command=%python_command% --enable-modules=%modules_enable%"
)
REM Save the constructed Python command to modules-xtts for testing
echo xtts_start_command=%python_command%>>%xtts_modules_path%
goto :edit_xtts_modules
REM ##################################################################################################################################################
REM ##################################################################################################################################################

View File

@@ -592,6 +592,7 @@ echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Adding voice example
xcopy "%~dp0voice-generation\xtts-api-server\example\*" "%~dp0voice-generation\xtts\speakers\" /y /e
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Removing the xtts-api-server directory...
cd /d "%~dp0"
rmdir /s /q "%~dp0voice-generation\xtts-api-server"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%XTTS installed successfully%reset%
pause
@@ -776,6 +777,7 @@ REM Install script for XTTS
xcopy "%~dp0voice-generation\xtts-api-server\example\*" "%~dp0voice-generation\xtts\speakers\" /y /e
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Removing the xtts-api-server directory...
cd /d "%~dp0"
rmdir /s /q "%~dp0voice-generation\xtts-api-server"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%XTTS installed successfully%reset%
REM End of install script for XTTS