From 5c4df671f786a60913d68a6eab1ad22cd933a02e Mon Sep 17 00:00:00 2001 From: deffcolony <61471128+deffcolony@users.noreply.github.com> Date: Sat, 21 Jun 2025 17:46:05 +0200 Subject: [PATCH] update launcher added uninstall and install functions in linux for: +stable difussion webui forge +tabbyapi +rvc python +alltalk tts v2 modified launcher to show more menus --- .../Voice_Generation/start_rvc_python.bat | 2 +- .../Image_Generation/install_sdwebuiforge.sh | 199 ++++++ .../Text_Completion/install_tabbyapi.sh | 304 +++++++++ .../install_tabbyapi_st_ext.sh | 194 ++++++ .../Voice_Generation/install_alltalk_v2.sh | 314 +++++++++ .../Voice_Generation/install_rvc_python.sh | 167 +++++ .../uninstall_sdwebuiforge.sh | 168 +++++ .../Text_Completion/uninstall_tabbyapi.sh | 167 +++++ .../Voice_Generation/uninstall_alltalk_v2.sh | 167 +++++ .../Voice_Generation/uninstall_rvc_python.sh | 167 +++++ launcher.sh | 619 ++++++++++++++++-- 11 files changed, 2423 insertions(+), 45 deletions(-) create mode 100644 bin/functions_linux/Toolbox/App_Installer/Image_Generation/install_sdwebuiforge.sh create mode 100644 bin/functions_linux/Toolbox/App_Installer/Text_Completion/install_tabbyapi.sh create mode 100644 bin/functions_linux/Toolbox/App_Installer/Text_Completion/install_tabbyapi_st_ext.sh create mode 100644 bin/functions_linux/Toolbox/App_Installer/Voice_Generation/install_alltalk_v2.sh create mode 100644 bin/functions_linux/Toolbox/App_Installer/Voice_Generation/install_rvc_python.sh create mode 100644 bin/functions_linux/Toolbox/App_Uninstaller/Image_Generation/uninstall_sdwebuiforge.sh create mode 100644 bin/functions_linux/Toolbox/App_Uninstaller/Text_Completion/uninstall_tabbyapi.sh create mode 100644 bin/functions_linux/Toolbox/App_Uninstaller/Voice_Generation/uninstall_alltalk_v2.sh create mode 100644 bin/functions_linux/Toolbox/App_Uninstaller/Voice_Generation/uninstall_rvc_python.sh diff --git a/bin/functions/Toolbox/App_Launcher/Voice_Generation/start_rvc_python.bat b/bin/functions/Toolbox/App_Launcher/Voice_Generation/start_rvc_python.bat index d5d5388..8464673 100644 --- a/bin/functions/Toolbox/App_Launcher/Voice_Generation/start_rvc_python.bat +++ b/bin/functions/Toolbox/App_Launcher/Voice_Generation/start_rvc_python.bat @@ -2,7 +2,7 @@ :start_rvc_python REM Activate the rvc-python environment -call conda activate rvc-python +call conda activate rvcpython REM Start rvc-python echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% rvc-python launched in a new window. diff --git a/bin/functions_linux/Toolbox/App_Installer/Image_Generation/install_sdwebuiforge.sh b/bin/functions_linux/Toolbox/App_Installer/Image_Generation/install_sdwebuiforge.sh new file mode 100644 index 0000000..5d2d685 --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Installer/Image_Generation/install_sdwebuiforge.sh @@ -0,0 +1,199 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Foreground colors +yellow_fg_strong_fg="\033[33;1m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_installer_image_generation_dir="$functions_dir/Toolbox/App_Installer/Image_Generation" +image_generation_dir="$stl_root/image-generation" +sdwebuiforge_install_path="$image_generation_dir/stable-diffusion-webui-forge" + +# Ensure log directory exists +mkdir -p "$log_dir" +logs_stl_console_path="$log_dir/stl_console.log" + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" + ;; + esac +} + +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} + +# Function to check if Miniconda3 is installed +check_miniconda() { + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then + log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" + log_message "INFO" "Please install Miniconda3 manually from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" + return 0 +} + +install_sdwebuiforge() { + clear + echo -e "${blue_fg_strong}/ Home / Toolbox / App Installer / Image Generation / Install Stable Diffusion Web UI Forge${reset}" + echo -e "-------------------------------------------------------------" + log_message "INFO" "Installing Stable Diffusion Web UI Forge..." + + # Check if the image-generation folder exists + if [[ ! -d "$image_generation_dir" ]]; then + mkdir -p "$image_generation_dir" + log_message "INFO" "Created folder: $image_generation_dir" + else + log_message "INFO" "image-generation folder already exists at: $image_generation_dir" + fi + + cd "$image_generation_dir" || { + log_message "ERROR" "Failed to change to directory: $image_generation_dir" + read -p "Press Enter to continue..." + bash "$app_installer_image_generation_dir/app_installer_image_generation.sh" + exit 1 + } + + max_retries=3 + retry_count=0 + + while [[ $retry_count -lt $max_retries ]]; do + log_message "INFO" "Cloning the stable-diffusion-webui-forge repository into: $sdwebuiforge_install_path" + git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git + if [[ $? -eq 0 ]]; then + if [[ -d "$sdwebuiforge_install_path" ]]; then + log_message "INFO" "Successfully cloned stable-diffusion-webui-forge into: $sdwebuiforge_install_path" + break + else + log_message "ERROR" "Clone succeeded but stable-diffusion-webui-forge directory not found at: $sdwebuiforge_install_path" + ((retry_count++)) + fi + else + ((retry_count++)) + log_message "WARN" "Retry $retry_count of $max_retries" + fi + if [[ $retry_count -ge $max_retries ]]; then + log_message "ERROR" "Failed to clone repository after $max_retries retries." + read -p "Press Enter to continue..." + exit + fi + done + + cd "$sdwebuiforge_install_path" + + # Activate the Miniconda installation + log_message "INFO" "Activating Miniconda environment..." + source "${miniconda_path}/etc/profile.d/conda.sh" + + # Create a Conda environment named sdwebuiforge + log_message "INFO" "Creating Conda environment: sdwebuiforge" + conda create -n sdwebuiforge python=3.10.6 -y + + # Activate the sdwebuiforge environment + log_message "INFO" "Activating Conda environment: sdwebuiforge" + conda activate sdwebuiforge + + # Install pip requirements + log_message "INFO" "Installing pip requirements" + pip install civitdl + + log_message "OK" "Stable Diffusion Web UI Forge installed successfully." + read -p "Press Enter to continue..." + exit +} + +# Execute the install function +find_conda +check_miniconda +install_sdwebuiforge \ No newline at end of file diff --git a/bin/functions_linux/Toolbox/App_Installer/Text_Completion/install_tabbyapi.sh b/bin/functions_linux/Toolbox/App_Installer/Text_Completion/install_tabbyapi.sh new file mode 100644 index 0000000..4e7521b --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Installer/Text_Completion/install_tabbyapi.sh @@ -0,0 +1,304 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Foreground colors +yellow_fg_strong_fg="\033[33;1m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_installer_text_completion_dir="$functions_dir/Toolbox/App_Installer/Text_Completion" +text_completion_dir="$stl_root/text-completion" +tabbyapi_install_path="$text_completion_dir/tabbyAPI" + +# Ensure log directory exists +mkdir -p "$log_dir" +logs_stl_console_path="$log_dir/stl_console.log" + + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') # Current time + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" + ;; + esac +} + +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} + +# Function to check if Miniconda3 is installed +check_miniconda() { + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then + log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" + log_message "INFO" "Please install Miniconda3 manually from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" + install_tabbyapi +} + + + +install_tabbyapi() { + clear + echo -e "${blue_fg_strong}/ Home / Toolbox / App Installer / Text Completion / Install TabbyAPI${reset}" + echo -e "-------------------------------------------------------------" + echo "What is your GPU?" + echo "1. NVIDIA" + echo "2. AMD" + echo "0. Cancel" + + # Get GPU information (Linux equivalent using lspci) + gpu_info=$(lspci | grep -E 'VGA|3D' | head -n 1 | awk '{print $0}') + if [[ -z "$gpu_info" ]]; then + gpu_info="No GPU detected" + fi + + echo + echo -e "${blue_bg}╔════ GPU INFO ═════════════════════════════════╗${reset}" + echo -e "${blue_bg}║ ║${reset}" + echo -e "${blue_bg}║* ${gpu_info} ${reset}" + echo -e "${blue_bg}║ ║${reset}" + echo -e "${blue_bg}╚═══════════════════════════════════════════════╝${reset}" + echo + + read -p "Enter number corresponding to your GPU: " gpu_choice + + # Set the GPU choice in an environment variable + export GPU_CHOICE="$gpu_choice" + + # Check the user's response + case "$gpu_choice" in + 1) + log_message "INFO" "GPU choice set to NVIDIA" + install_tabbyapi_pre + ;; + 2) + log_message "INFO" "GPU choice set to AMD" + install_tabbyapi_pre + ;; + 0) + exit + ;; + *) + log_message "ERROR" "Invalid input" + read -p "Press Enter to continue..." + install_tabbyapi + ;; + esac +} + +install_tabbyapi_pre() { + log_message "INFO" "Installing TabbyAPI..." + + # Ensure the text-completion folder exists + if [[ ! -d "$text_completion_dir" ]]; then + mkdir -p "$text_completion_dir" + log_message "INFO" "Created folder: $text_completion_dir" + else + log_message "INFO" "text-completion folder already exists at: $text_completion_dir" + fi + + # Remove existing tabbyAPI directory if it exists to avoid cloning conflicts + if [[ -d "$tabbyapi_install_path" ]]; then + log_message "WARN" "Existing tabbyAPI directory found at: $tabbyapi_install_path. Removing it..." + rm -rf "$tabbyapi_install_path" + fi + + # Check for incorrect tabbyAPI directory in stl_root + if [[ -d "$stl_root/tabbyAPI" ]]; then + log_message "WARN" "Incorrect tabbyAPI directory found at: $stl_root/tabbyAPI. Removing it..." + rm -rf "$stl_root/tabbyAPI" + fi + + cd "$text_completion_dir" || { + log_message "ERROR" "Failed to change to directory: $text_completion_dir" + read -p "Press Enter to continue..." + exit + } + + max_retries=3 + retry_count=0 + + while [[ $retry_count -lt $max_retries ]]; do + log_message "INFO" "Cloning the tabbyAPI repository into: $tabbyapi_install_path" + git clone https://github.com/theroyallab/tabbyAPI.git + if [[ $? -eq 0 ]]; then + # Verify the clone created the correct directory + if [[ -d "$tabbyapi_install_path" ]]; then + log_message "INFO" "Successfully cloned tabbyAPI into: $tabbyapi_install_path" + break + else + log_message "ERROR" "Clone succeeded but tabbyAPI directory not found at: $tabbyapi_install_path" + ((retry_count++)) + fi + else + ((retry_count++)) + log_message "WARN" "Retry $retry_count of $max_retries" + fi + if [[ $retry_count -ge $max_retries ]]; then + log_message "ERROR" "Failed to clone repository after $max_retries retries." + read -p "Press Enter to continue..." + exit + fi + done + + # Activate the Miniconda installation + log_message "INFO" "Activating Miniconda environment..." + source "${miniconda_path}/etc/profile.d/conda.sh" + + # Create a Conda environment named tabbyapi + log_message "INFO" "Creating Conda environment: tabbyapi" + conda create -n tabbyapi python=3.11 -y + + # Activate the conda environment named tabbyapi + log_message "INFO" "Activating Conda environment: tabbyapi" + conda activate tabbyapi + + cd "$tabbyapi_install_path" + + # Use the GPU choice made earlier to configure tabbyapi + case "$GPU_CHOICE" in + 1) + log_message "INFO" "[tabbyapi] Setting TabbyAPI to use NVIDIA GPUs: tabbyapi" + echo "cu121" > "gpu_lib.txt" + install_tabbyapi_final + ;; + 2) + log_message "INFO" "[tabbyapi] Setting TabbyAPI to use AMD GPUs: tabbyapi" + echo "amd" > "gpu_lib.txt" + install_tabbyapi_final + ;; + esac +} + +install_tabbyapi_final() { + log_message "INFO" "Downgrading numpy to: 1.26.4" + pip install numpy==1.26.4 + + echo "Loading solely the API may not be your optimal usecase." + echo "Therefore, a config.yml exists to tune initial launch parameters and other configuration options." + echo + echo "A config.yml file is required for overriding project defaults." + echo "If you are okay with the defaults, you don't need a config file!" + echo + echo "If you do want a config file, copy over config_sample.yml to config.yml. All the fields are commented," + echo "so make sure to read the descriptions and comment out or remove fields that you don't need." + echo + + log_message "INFO" "TabbyAPI installed successfully." + + log_message "INFO" "Updating TabbyAPI Dependencies..." + log_message "WARN" "This process could take a while, typically around 10 minutes or less. Please be patient and do not close this window until the update is complete." + + # Run the update process and log the output + python start.py --update-deps > "$log_dir/tabby_update_log.txt" 2>&1 + + # Scan the log file for the specific success message + if grep -q "Dependencies updated. Please run TabbyAPI" "$log_dir/tabby_update_log.txt"; then + log_message "INFO" "OK" + else + log_message "ERROR" "TabbyAPI Update Failed. Please run the installer again" + fi + + # Delete the log file + rm -f "$log_dir/tabby_update_log.txt" + + log_message "INFO" "TabbyAPI Dependencies updated successfully." + read -p "Press Enter to continue..." + exit +} + + +# Execute the install function +find_conda +check_miniconda +install_tabbyapi \ No newline at end of file diff --git a/bin/functions_linux/Toolbox/App_Installer/Text_Completion/install_tabbyapi_st_ext.sh b/bin/functions_linux/Toolbox/App_Installer/Text_Completion/install_tabbyapi_st_ext.sh new file mode 100644 index 0000000..73d6e3a --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Installer/Text_Completion/install_tabbyapi_st_ext.sh @@ -0,0 +1,194 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Foreground colors +yellow_fg_strong_fg="\033[33;1m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_installer_text_completion_dir="$functions_dir/Toolbox/App_Installer/Text_Completion" +st_install_path="$stl_root/SillyTavern" +text_completion_dir="$stl_root/text-completion" +tabbyapi_install_path="$text_completion_dir/tabbyAPI" + +# Ensure log directory exists +if ! mkdir -p "$log_dir"; then + echo -e "${red_bg}[$(date +'%H:%M:%S')]${reset} ${red_fg_strong}[ERROR]${reset} Failed to create log directory: $log_dir" + exit 1 +fi +logs_stl_console_path="$log_dir/stl_console.log" + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + esac +} + +install_tabbyapi_st_ext() { + clear + echo -e "${blue_fg_strong}/ Home / Toolbox / App Installer / Text Completion / Install ST-tabbyAPI-loader Extension${reset}" + echo -e "-------------------------------------------------------------" + + # Check if SillyTavern data directory exists + if [[ ! -d "$st_install_path/data" ]]; then + log_message "ERROR" "SillyTavern data directory not found at: $st_install_path/data" + read -p "Press Enter to continue..." + exit + fi + + # Check if git is installed + if ! command -v git &> /dev/null; then + log_message "ERROR" "Git is not installed. Please install git and try again." + read -p "Press Enter to continue..." + exit + fi + + # Scan for user folders, excluding _storage and _uploads + user_folders=() + while IFS= read -r -d '' folder; do + folder_name=$(basename "$folder") + if [[ "$folder_name" != "_storage" && "$folder_name" != "_uploads" ]]; then + user_folders+=("$folder_name") + fi + done < <(find "$st_install_path/data" -maxdepth 1 -type d -not -path "$st_install_path/data" -print0) + + # Check if any user folders were found + if [ ${#user_folders[@]} -eq 0 ]; then + log_message "ERROR" "No user folders found in $st_install_path/data" + read -p "Press Enter to continue..." + exit + fi + + # Check if default-user exists + default_user_exists=false + for folder in "${user_folders[@]}"; do + if [[ "$folder" == "default-user" ]]; then + default_user_exists=true + break + fi + done + + # If default-user exists or multiple folders are found, prompt for selection + if [[ "$default_user_exists" == true || ${#user_folders[@]} -gt 1 ]]; then + echo "Detected accounts:" + echo "================================" + for i in "${!user_folders[@]}"; do + echo -e "$((i+1)). ${cyan_fg_strong}${user_folders[i]}${reset}" + done + echo "================================" + echo "0. Cancel" + echo + + # Prompt user to select a folder + read -p "Select a folder to install ST-tabbyAPI-loader: " user_choice + + # Check if the user wants to cancel + if [ "$user_choice" = "0" ]; then + log_message "INFO" "Installation canceled." + read -p "Press Enter to continue..." + exit + fi + + # Validate user choice + if ! [[ "$user_choice" =~ ^[0-9]+$ ]]; then + log_message "ERROR" "Invalid input. Please enter a number." + read -p "Press Enter to continue..." + install_tabbyapi_st_ext + return + fi + + if [ "$user_choice" -ge 1 ] && [ "$user_choice" -le ${#user_folders[@]} ]; then + selected_user_folder="${user_folders[$((user_choice-1))]}" + else + log_message "ERROR" "Invalid selection. Please enter a number between 1 and ${#user_folders[@]}, or 0 to cancel." + read -p "Press Enter to continue..." + install_tabbyapi_st_ext + return + fi + else + # Auto-select the only folder if default-user doesn't exist + selected_user_folder="${user_folders[0]}" + log_message "INFO" "Only one user folder found: $selected_user_folder" + fi + + # Create extensions directory + extensions_dir="$st_install_path/data/$selected_user_folder/extensions" + if ! mkdir -p "$extensions_dir"; then + log_message "ERROR" "Failed to create directory: $extensions_dir" + read -p "Press Enter to continue..." + exit + fi + + # Check if extension already exists + if [[ -d "$extensions_dir/ST-tabbyAPI-loader" ]]; then + log_message "WARN" "ST-tabbyAPI-loader already exists in $extensions_dir." + read -p "Press Enter to continue..." + exit + fi + + # Install the extension in the selected user folder + log_message "INFO" "Installing ST-tabbyAPI-loader extension in $extensions_dir..." + cd "$extensions_dir" || { + log_message "ERROR" "Failed to change to directory: $extensions_dir" + read -p "Press Enter to continue..." + exit + } + + git clone https://github.com/theroyallab/ST-tabbyAPI-loader.git + if [ $? -eq 0 ]; then + log_message "OK" "ST-tabbyAPI-loader Extension for SillyTavern has been installed successfully in $extensions_dir/ST-tabbyAPI-loader." + else + log_message "ERROR" "Failed to clone ST-tabbyAPI-loader repository." + read -p "Press Enter to continue..." + exit + fi + + read -p "Press Enter to continue..." + exit +} + +# Execute the install function +install_tabbyapi_st_ext \ No newline at end of file diff --git a/bin/functions_linux/Toolbox/App_Installer/Voice_Generation/install_alltalk_v2.sh b/bin/functions_linux/Toolbox/App_Installer/Voice_Generation/install_alltalk_v2.sh new file mode 100644 index 0000000..3d29bc0 --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Installer/Voice_Generation/install_alltalk_v2.sh @@ -0,0 +1,314 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_installer_voice_generation_dir="$functions_dir/Toolbox/App_Installer/Voice_Generation" +voice_generation_dir="$stl_root/voice-generation" +alltalk_v2_install_path="$voice_generation_dir/alltalk_tts" +miniconda_path="$stl_root/miniconda" + +# Ensure log directory exists +if ! mkdir -p "$log_dir"; then + echo -e "${red_bg}[$(date +'%H:%M:%S')]${reset} ${red_fg_strong}[ERROR]${reset} Failed to create log directory: $log_dir" + exit 1 +fi +logs_stl_console_path="$log_dir/stl_console.log" + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" | tee -a "$logs_stl_console_path" + ;; + esac +} + +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} + +# Function to check if Miniconda3 is installed +check_miniconda() { + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then + log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" + log_message "INFO" "Please install Miniconda3 manually from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" + install_tabbyapi +} + + + +install_alltalk_v2() { + clear + echo -e "${blue_fg_strong}/ Home / Toolbox / App Installer / Voice Generation / Install AllTalk V2${reset}" + echo -e "-------------------------------------------------------------" + + # Check if git is installed + if ! command -v git &> /dev/null; then + log_message "ERROR" "Git is not installed. Please install git and try again." + read -p "Press Enter to continue..." + exit + fi + + # GPU menu - Frontend + echo "What is your GPU?" + echo "1. NVIDIA" + echo "2. AMD" + echo "0. Cancel" + + # Get GPU information + gpu_info=$(lspci | grep -E "VGA|3D" | grep -Ei "NVIDIA|AMD" | head -n 1 | awk -F: '{print $3}' | sed 's/^[[:space:]]*//') + if [[ -z "$gpu_info" ]]; then + gpu_info="No GPU detected" + fi + + echo -e "${blue_bg}╔════ GPU INFO ═════════════════════════════════╗${reset}" + echo -e "${blue_bg}║ ║${reset}" + echo -e "${blue_bg}║* ${gpu_info}${reset}" + echo -e "${blue_bg}║ ║${reset}" + echo -e "${blue_bg}╚═══════════════════════════════════════════════╝${reset}" + echo + + read -p "Enter number corresponding to your GPU: " gpu_choice + + # Validate GPU choice + if [[ ! "$gpu_choice" =~ ^[0-2]$ ]]; then + log_message "ERROR" "Invalid input. Please enter a valid number (0-2)." + read -p "Press Enter to continue..." + install_alltalk_v2 + return + fi + + # Check the user's response + case "$gpu_choice" in + "1") + log_message "INFO" "GPU choice set to NVIDIA" + ;; + "2") + log_message "INFO" "GPU choice set to AMD" + ;; + "0") + log_message "INFO" "Installation canceled." + read -p "Press Enter to continue..." + exit + ;; + esac + + # Check and create voice-generation directory + if [[ ! -d "$voice_generation_dir" ]]; then + if ! mkdir -p "$voice_generation_dir"; then + log_message "ERROR" "Failed to create directory: $voice_generation_dir" + read -p "Press Enter to continue..." + exit + fi + log_message "INFO" "Created folder: voice-generation" + else + log_message "INFO" "voice-generation folder already exists." + fi + + cd "$voice_generation_dir" + + # Check if alltalk_tts already exists + if [[ -d "$alltalk_v2_install_path" ]]; then + log_message "WARN" "alltalk_tts already exists in $voice_generation_dir." + read -p "Press Enter to continue..." + exit + fi + + # Clone repository with retry logic + max_retries=3 + retry_count=0 + + while [ $retry_count -lt $max_retries ]; do + log_message "INFO" "Cloning alltalk_tts repository..." + git clone -b alltalkbeta https://github.com/erew123/alltalk_tts + if [ $? -eq 0 ]; then + break + else + retry_count=$((retry_count + 1)) + log_message "WARN" "Retry $retry_count of $max_retries" + if [ $retry_count -eq $max_retries ]; then + log_message "ERROR" "Failed to clone repository after $max_retries retries." + read -p "Press Enter to continue..." + exit + fi + fi + done + + cd "$alltalk_v2_install_path" || { + log_message "ERROR" "Failed to change to directory: $alltalk_v2_install_path" + read -p "Press Enter to continue..." + exit + } + + # Install system dependencies + log_message "INFO" "Installing system dependencies..." + if command -v apt &> /dev/null; then + sudo apt update + sudo apt install -y build-essential espeak-ng ffmpeg + else + log_message "WARN" "APT not found. Please ensure build-essential, espeak-ng, and ffmpeg are installed." + fi + + # Activate Miniconda and create environment + log_message "INFO" "Activating Miniconda environment..." + if [[ ! -f "$miniconda_path/bin/activate" ]]; then + log_message "ERROR" "Miniconda not found at $miniconda_path. Please install Miniconda." + read -p "Press Enter to continue..." + exit + fi + + source "$miniconda_path/bin/activate" + log_message "INFO" "Creating Conda environment: alltalkv2" + conda create -n alltalkv2 python=3.11.9 -y + log_message "INFO" "Activating Conda environment: alltalkv2" + conda activate alltalkv2 + + # Install GPU-specific dependencies + if [ "$gpu_choice" = "1" ]; then + log_message "INFO" "[alltalkv2] Installing NVIDIA version of PyTorch in conda environment: alltalkv2" + conda install -y pytorch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 pytorch-cuda=12.1 -c pytorch -c nvidia + + log_message "INFO" "[alltalkv2] Installing deepspeed..." + curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.0+ce78a63-cp311-cp311-linux_x86_64.whl + pip install deepspeed-0.14.0+ce78a63-cp311-cp311-linux_x86_64.whl + rm deepspeed-0.14.0+ce78a63-cp311-cp311-linux_x86_64.whl + elif [ "$gpu_choice" = "2" ]; then + log_message "INFO" "[alltalkv2] Installing AMD dependencies..." + pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6 + fi + + # Install additional dependencies + log_message "INFO" "[alltalkv2] Installing Faiss..." + conda install -y -c pytorch faiss-cpu + + log_message "INFO" "[alltalkv2] Installing FFmpeg..." + conda install -y -c conda-forge "ffmpeg=*=*gpl*" + conda install -y -c conda-forge "ffmpeg=*=h*_*" --no-deps + + log_message "INFO" "[alltalkv2] Installing pip requirements from requirements_standalone.txt" + if [[ -f "system/requirements/requirements_standalone.txt" ]]; then + pip install -r system/requirements/requirements_standalone.txt + else + log_message "ERROR" "requirements_standalone.txt not found." + read -p "Press Enter to continue..." + exit + fi + + log_message "INFO" "[alltalkv2] Updating Gradio..." + pip install gradio==4.32.2 # 4.44.1 is bugged + + log_message "INFO" "[alltalkv2] Updating transformers..." + pip install transformers==4.42.4 + + log_message "INFO" "[alltalkv2] Installing temporary fix for pydantic..." + pip install pydantic==2.10.6 + + log_message "INFO" "[alltalkv2] Installing Parler..." + if [[ -f "system/requirements/requirements_parler.txt" ]]; then + pip install -r system/requirements/requirements_parler.txt + else + log_message "ERROR" "requirements_parler.txt not found." + read -p "Press Enter to continue..." + exit + fi + + log_message "INFO" "Cleaning Conda cache..." + conda clean --all --force-pkgs-dirs -y + + log_message "OK" "AllTalk V2 installed successfully" + read -p "Press Enter to continue..." + exit +} + +# Execute the install function +install_alltalk_v2 \ No newline at end of file diff --git a/bin/functions_linux/Toolbox/App_Installer/Voice_Generation/install_rvc_python.sh b/bin/functions_linux/Toolbox/App_Installer/Voice_Generation/install_rvc_python.sh new file mode 100644 index 0000000..2f7f825 --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Installer/Voice_Generation/install_rvc_python.sh @@ -0,0 +1,167 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Foreground colors +yellow_fg_strong_fg="\033[33;1m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_uninstaller_voice_generation_dir="$functions_dir/Toolbox/App_Uninstaller/Voice_Generation" +voice_generation_dir="$stl_root/voice-generation" +rvc_python_install_path="$voice_generation_dir/rvc-python" + +# Ensure log directory exists +mkdir -p "$log_dir" +logs_stl_console_path="$log_dir/stl_console.log" + + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') # Current time + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" + ;; + esac +} + +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} + +# Function to check if Miniconda3 is installed +check_miniconda() { + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then + log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" + log_message "INFO" "Please install Miniconda3 manually from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" +} + +uninstall_rvc_python() { + echo -e "${red_bg}╔════ DANGER ZONE ══════════════════════════════════════════════════════════════════════════════╗${reset}" + echo -e "${red_bg}║ WARNING: This will delete all data of rvc-python ║${reset}" + echo -e "${red_bg}║ If you want to keep any data, make sure to create a backup before proceeding. ║${reset}" + echo -e "${red_bg}╚═══════════════════════════════════════════════════════════════════════════════════════════════╝${reset}" + echo + + read -p "Are you sure you want to proceed? [Y/N]: " confirmation + if [[ "${confirmation^^}" == "Y" ]]; then + # Activate the Miniconda installation + log_message "INFO" "Activating Miniconda environment..." + source "${miniconda_path}/etc/profile.d/conda.sh" + + # Remove the Conda environment + log_message "INFO" "Removing the Conda environment: rvcpython" + conda deactivate + conda remove --name rvcpython --all -y + conda clean -a -y + + # Remove the rvc-python directory + if [[ -d "$rvc_python_install_path" ]]; then + log_message "INFO" "Removing the rvc-python directory at: $rvc_python_install_path" + rm -rf "$rvc_python_install_path" + else + log_message "INFO" "No rvc-python directory found at: $rvc_python_install_path" + fi + + log_message "INFO" "rvc-python has been uninstalled successfully." + read -p "Press Enter to continue..." + exit + else + log_message "INFO" "Uninstall canceled." + read -p "Press Enter to continue..." + exit + fi +} + +# Execute the uninstall function +find_conda +check_miniconda +uninstall_rvc_python \ No newline at end of file diff --git a/bin/functions_linux/Toolbox/App_Uninstaller/Image_Generation/uninstall_sdwebuiforge.sh b/bin/functions_linux/Toolbox/App_Uninstaller/Image_Generation/uninstall_sdwebuiforge.sh new file mode 100644 index 0000000..9e59928 --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Uninstaller/Image_Generation/uninstall_sdwebuiforge.sh @@ -0,0 +1,168 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Foreground colors +yellow_fg_strong_fg="\033[33;1m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_uninstaller_image_generation_dir="$functions_dir/Toolbox/App_Uninstaller/Image_Generation" +image_generation_dir="$stl_root/image-generation" +sdwebuiforge_install_path="$image_generation_dir/stable-diffusion-webui-forge" + +# Ensure log directory exists +mkdir -p "$log_dir" +logs_stl_console_path="$log_dir/stl_console.log" + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" + ;; + esac +} + +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} + + +# Function to check if Miniconda3 is installed +check_miniconda() { + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then + log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" + log_message "INFO" "No Conda environment to remove." + return 1 + fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "No Conda environment to remove." + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "No Conda environment to remove." + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" + return 0 +} + +uninstall_sdwebuiforge() { + echo -e "${red_bg}╔════ DANGER ZONE ══════════════════════════════════════════════════════════════════════════════╗${reset}" + echo -e "${red_bg}║ WARNING: This will delete all data of Stable Diffusion Web UI Forge ║${reset}" + echo -e "${red_bg}║ If you want to keep any data, make sure to create a backup before proceeding. ║${reset}" + echo -e "${red_bg}╚═══════════════════════════════════════════════════════════════════════════════════════════════╝${reset}" + echo + + read -p "Are you sure you want to proceed? [Y/N]: " confirmation + if [[ "${confirmation^^}" == "Y" ]]; then + # Activate the Miniconda installation + log_message "INFO" "Activating Miniconda environment..." + source "${miniconda_path}/etc/profile.d/conda.sh" + + # Remove the Conda environment + log_message "INFO" "Removing the Conda environment: sdwebuiforge" + conda deactivate + conda remove --name sdwebuiforge --all -y + conda clean -a -y + + # Remove the stable-diffusion-webui-forge directory + if [[ -d "$sdwebuiforge_install_path" ]]; then + log_message "INFO" "Removing the stable-diffusion-webui-forge directory at: $sdwebuiforge_install_path" + rm -rf "$sdwebuiforge_install_path" + else + log_message "INFO" "No stable-diffusion-webui-forge directory found at: $sdwebuiforge_install_path" + fi + + log_message "INFO" "Stable Diffusion Web UI has been uninstalled successfully." + read -p "Press Enter to continue..." + exit + else + log_message "INFO" "Uninstall canceled." + read -p "Press Enter to continue..." + exit + fi +} + +# Execute the uninstall function +find_conda +check_miniconda +uninstall_sdwebuiforge \ No newline at end of file diff --git a/bin/functions_linux/Toolbox/App_Uninstaller/Text_Completion/uninstall_tabbyapi.sh b/bin/functions_linux/Toolbox/App_Uninstaller/Text_Completion/uninstall_tabbyapi.sh new file mode 100644 index 0000000..ce76cd8 --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Uninstaller/Text_Completion/uninstall_tabbyapi.sh @@ -0,0 +1,167 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Foreground colors +yellow_fg_strong_fg="\033[33;1m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_uninstaller_text_completion_dir="$functions_dir/Toolbox/App_Uninstaller/Text_Completion" +text_completion_dir="$stl_root/text-completion" +tabbyapi_install_path="$text_completion_dir/tabbyAPI" + +# Ensure log directory exists +mkdir -p "$log_dir" +logs_stl_console_path="$log_dir/stl_console.log" + + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') # Current time + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" + ;; + esac +} + +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} + +# Function to check if Miniconda3 is installed +check_miniconda() { + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then + log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" + log_message "INFO" "Please install Miniconda3 manually from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" +} + +uninstall_tabbyapi() { + echo -e "${red_bg}╔════ DANGER ZONE ══════════════════════════════════════════════════════════════════════════════╗${reset}" + echo -e "${red_bg}║ WARNING: This will delete all data of TabbyAPI ║${reset}" + echo -e "${red_bg}║ If you want to keep any data, make sure to create a backup before proceeding. ║${reset}" + echo -e "${red_bg}╚═══════════════════════════════════════════════════════════════════════════════════════════════╝${reset}" + echo + + read -p "Are you sure you want to proceed? [Y/N]: " confirmation + if [[ "${confirmation^^}" == "Y" ]]; then + # Activate the Miniconda installation + log_message "INFO" "Activating Miniconda environment..." + source "${miniconda_path}/etc/profile.d/conda.sh" + + # Remove the Conda environment + log_message "INFO" "Removing the Conda environment: tabbyapi" + conda deactivate + conda remove --name tabbyapi --all -y + conda clean -a -y + + # Remove the tabbyAPI directory + if [[ -d "$tabbyapi_install_path" ]]; then + log_message "INFO" "Removing the tabbyAPI directory at: $tabbyapi_install_path" + rm -rf "$tabbyapi_install_path" + else + log_message "INFO" "No tabbyAPI directory found at: $tabbyapi_install_path" + fi + + log_message "INFO" "TabbyAPI has been uninstalled successfully." + read -p "Press Enter to continue..." + exit + else + log_message "INFO" "Uninstall canceled." + read -p "Press Enter to continue..." + exit + fi +} + +# Execute the uninstall function +find_conda +check_miniconda +uninstall_tabbyapi \ No newline at end of file diff --git a/bin/functions_linux/Toolbox/App_Uninstaller/Voice_Generation/uninstall_alltalk_v2.sh b/bin/functions_linux/Toolbox/App_Uninstaller/Voice_Generation/uninstall_alltalk_v2.sh new file mode 100644 index 0000000..d394b4a --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Uninstaller/Voice_Generation/uninstall_alltalk_v2.sh @@ -0,0 +1,167 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Foreground colors +yellow_fg_strong_fg="\033[33;1m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_uninstaller_voice_generation_dir="$functions_dir/Toolbox/App_Uninstaller/Voice_Generation" +voice_generation_dir="$stl_root/voice-generation" +alltalk_v2_install_path="$voice_generation_dir/alltalk_tts" + +# Ensure log directory exists +mkdir -p "$log_dir" +logs_stl_console_path="$log_dir/stl_console.log" + + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') # Current time + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" + ;; + esac +} + +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} + +# Function to check if Miniconda3 is installed +check_miniconda() { + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then + log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" + log_message "INFO" "Please install Miniconda3 manually from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" +} + +uninstall_alltalk_v2() { + echo -e "${red_bg}╔════ DANGER ZONE ══════════════════════════════════════════════════════════════════════════════╗${reset}" + echo -e "${red_bg}║ WARNING: This will delete all data of AllTalk V2 ║${reset}" + echo -e "${red_bg}║ If you want to keep any data, make sure to create a backup before proceeding. ║${reset}" + echo -e "${red_bg}╚═══════════════════════════════════════════════════════════════════════════════════════════════╝${reset}" + echo + + read -p "Are you sure you want to proceed? [Y/N]: " confirmation + if [[ "${confirmation^^}" == "Y" ]]; then + # Activate the Miniconda installation + log_message "INFO" "Activating Miniconda environment..." + source "${miniconda_path}/etc/profile.d/conda.sh" + + # Remove the Conda environment + log_message "INFO" "Removing the Conda environment: alltalkv2" + conda deactivate + conda remove --name alltalkv2 --all -y + conda clean -a -y + + # Remove the alltalk_tts directory + if [[ -d "$alltalk_v2_install_path" ]]; then + log_message "INFO" "Removing the alltalk_tts directory at: $alltalk_v2_install_path" + rm -rf "$alltalk_v2_install_path" + else + log_message "INFO" "No alltalk_tts directory found at: $alltalk_v2_install_path" + fi + + log_message "INFO" "AllTalk V2 has been uninstalled successfully." + read -p "Press Enter to continue..." + exit + else + log_message "INFO" "Uninstall canceled." + read -p "Press Enter to continue..." + exit + fi +} + +# Execute the uninstall function +find_conda +check_miniconda +uninstall_alltalk_v2 \ No newline at end of file diff --git a/bin/functions_linux/Toolbox/App_Uninstaller/Voice_Generation/uninstall_rvc_python.sh b/bin/functions_linux/Toolbox/App_Uninstaller/Voice_Generation/uninstall_rvc_python.sh new file mode 100644 index 0000000..2f7f825 --- /dev/null +++ b/bin/functions_linux/Toolbox/App_Uninstaller/Voice_Generation/uninstall_rvc_python.sh @@ -0,0 +1,167 @@ +#!/bin/bash + +# ANSI Escape Code for Colors +reset="\033[0m" +white_fg_strong="\033[90m" +red_fg_strong="\033[91m" +green_fg_strong="\033[92m" +yellow_fg_strong="\033[93m" +blue_fg_strong="\033[94m" +magenta_fg_strong="\033[95m" +cyan_fg_strong="\033[96m" + +# Text styles +bold="\033[1m" + +# Normal Background Colors +red_bg="\033[41m" +blue_bg="\033[44m" +yellow_bg="\033[43m" +green_bg="\033[42m" + +# Foreground colors +yellow_fg_strong_fg="\033[33;1m" + +# Set stl_root dynamically if not already set by launcher.sh +if [[ -z "$stl_root" ]]; then + # Navigate up 5 directories from the script's location + script_dir="$(dirname "$(realpath "$0")")" + stl_root="$(realpath "$script_dir/../../../../../")" +fi + +# Use directory variables +bin_dir="$stl_root/bin" +log_dir="$bin_dir/logs" +functions_dir="$bin_dir/functions_linux" +app_uninstaller_voice_generation_dir="$functions_dir/Toolbox/App_Uninstaller/Voice_Generation" +voice_generation_dir="$stl_root/voice-generation" +rvc_python_install_path="$voice_generation_dir/rvc-python" + +# Ensure log directory exists +mkdir -p "$log_dir" +logs_stl_console_path="$log_dir/stl_console.log" + + +# Function to log messages with timestamps and colors +log_message() { + current_time=$(date +'%H:%M:%S') # Current time + case "$1" in + "INFO") + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[INFO]${reset} $2" + ;; + "WARN") + echo -e "${yellow_bg}[$current_time]${reset} ${yellow_fg_strong}[WARN]${reset} $2" + ;; + "ERROR") + echo -e "${red_bg}[$current_time]${reset} ${red_fg_strong}[ERROR]${reset} $2" + ;; + "OK") + echo -e "${green_bg}[$current_time]${reset} ${green_fg_strong}[OK]${reset} $2" + ;; + *) + echo -e "${blue_bg}[$current_time]${reset} ${blue_fg_strong}[DEBUG]${reset} $2" + ;; + esac +} + +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} + +# Function to check if Miniconda3 is installed +check_miniconda() { + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then + log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" + log_message "INFO" "Please install Miniconda3 manually from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" +} + +uninstall_rvc_python() { + echo -e "${red_bg}╔════ DANGER ZONE ══════════════════════════════════════════════════════════════════════════════╗${reset}" + echo -e "${red_bg}║ WARNING: This will delete all data of rvc-python ║${reset}" + echo -e "${red_bg}║ If you want to keep any data, make sure to create a backup before proceeding. ║${reset}" + echo -e "${red_bg}╚═══════════════════════════════════════════════════════════════════════════════════════════════╝${reset}" + echo + + read -p "Are you sure you want to proceed? [Y/N]: " confirmation + if [[ "${confirmation^^}" == "Y" ]]; then + # Activate the Miniconda installation + log_message "INFO" "Activating Miniconda environment..." + source "${miniconda_path}/etc/profile.d/conda.sh" + + # Remove the Conda environment + log_message "INFO" "Removing the Conda environment: rvcpython" + conda deactivate + conda remove --name rvcpython --all -y + conda clean -a -y + + # Remove the rvc-python directory + if [[ -d "$rvc_python_install_path" ]]; then + log_message "INFO" "Removing the rvc-python directory at: $rvc_python_install_path" + rm -rf "$rvc_python_install_path" + else + log_message "INFO" "No rvc-python directory found at: $rvc_python_install_path" + fi + + log_message "INFO" "rvc-python has been uninstalled successfully." + read -p "Press Enter to continue..." + exit + else + log_message "INFO" "Uninstall canceled." + read -p "Press Enter to continue..." + exit + fi +} + +# Execute the uninstall function +find_conda +check_miniconda +uninstall_rvc_python \ No newline at end of file diff --git a/launcher.sh b/launcher.sh index 64cd95a..edd9333 100755 --- a/launcher.sh +++ b/launcher.sh @@ -40,12 +40,6 @@ red_bg="\033[41m" blue_bg="\033[44m" yellow_bg="\033[43m" -# Environment Variables (miniconda3) -miniconda_path="$HOME/miniconda3" -miniconda_path_mingw="$miniconda_path/Library/mingw-w64/bin" -miniconda_path_usrbin="$miniconda_path/Library/usr/bin" -miniconda_path_bin="$miniconda_path/Library/bin" -miniconda_path_scripts="$miniconda_path/Scripts" # Environment Variables (FFmpeg) ffmpeg_download_url="https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z" @@ -188,7 +182,7 @@ rvc_install_path="$voice_generation_dir/Retrieval-based-Voice-Conversion-WebUI" # Define variables for the core directories bin_dir="$stl_root/bin" log_dir="$bin_dir/logs" -functions_dir="$bin_dir/functions" +functions_dir="$bin_dir/functions_linux" # Define variables for the directories for Toolbox toolbox_dir="$functions_dir/Toolbox" @@ -255,7 +249,36 @@ log_message() { #read -p "Press Enter to continue..." +# Function to find Miniconda installation directory +find_conda() { + local paths=( + "$HOME/miniconda3" + "$HOME/miniconda" + "/opt/miniconda3" + "/opt/miniconda" + "/usr/local/miniconda3" + "/usr/local/miniconda" + "/usr/miniconda3" + "/usr/miniconda" + "$HOME/anaconda3" + "$HOME/anaconda" + "/opt/anaconda3" + "/opt/anaconda" + "/usr/local/anaconda3" + "/usr/local/anaconda" + "/usr/anaconda3" + "/usr/anaconda" + ) + for path in "${paths[@]}"; do + if [ -d "$path" ]; then + echo "$path" + return 0 + fi + done + + return 1 +} # Function to install Git install_git() { @@ -481,7 +504,7 @@ create_backup() { echo -e "\033]0;STL [CREATE BACKUP]\007" clear echo -e "${blue_fg_strong}| > / Home / Toolbox / Backup / Create Backup |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" # Scan for user folders user_folders=() @@ -571,7 +594,7 @@ restore_backup() { echo -e "\033]0;STL [RESTORE BACKUP]\007" clear echo -e "${blue_fg_strong}| > / Home / Toolbox / Backup / Restore Backup |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| Available Backups |${reset}" @@ -663,7 +686,7 @@ backup() { echo -e "\033]0;STL [BACKUP]\007" clear echo -e "${blue_fg_strong}| > / Home / Toolbox / Backup |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" echo " 1. Create Backup" @@ -1003,7 +1026,7 @@ config_tailscale() { clear echo -e "${blue_fg_strong}| > / Home / Toolbox / App Installer / Core Utilities / Tailscale${reset}" - echo -e "${blue_fg_strong}============================================================================================${reset}" + echo -e "${blue_fg_strong} ============================================================================================${reset}" echo -e "${cyan_fg_strong}____________________________________________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" @@ -1106,7 +1129,7 @@ editor_core_utilities() { fi echo -e "${blue_fg_strong}| > / Home / Toolbox / Editor / Core Utilities |${reset}" - echo -e "${blue_fg_strong}============================================================================================${reset}" + echo -e "${blue_fg_strong} ============================================================================================${reset}" echo -e "${cyan_fg_strong}____________________________________________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" @@ -1152,7 +1175,7 @@ editor() { echo -e "\033]0;STL [EDITOR]\007" clear echo -e "${blue_fg_strong}| > / Home / Toolbox / Editor |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" echo " 1. Text Completion" @@ -1194,6 +1217,14 @@ remove_node_modules() { troubleshooting } +remove_npm_cache() { + log_message "INFO" "Clearing npm cache..." + npm cache clean --force + log_message "INFO" "npm cache cleared successfully." + read -p "Press Enter to continue..." + troubleshooting +} + remove_pip_cache() { log_message "INFO" "Clearing pip cache..." pip cache purge @@ -1223,7 +1254,7 @@ find_app_port() { echo -e "\033]0;STL [FIND APP PORT]\007" clear echo -e "${blue_fg_strong}| > / Home / Troubleshooting & Support / Find App Port |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| Menu Options: |${reset}" echo " 0. Cancel" @@ -1312,7 +1343,7 @@ discord_servers_menu() { echo -e "\033]0;STL [DISCORD SERVERS]\007" clear echo -e "${blue_fg_strong}| > / Home / Troubleshooting & Support / Discord Servers |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo " 1. Join SillyTavern" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| Discord - LLM Backends: |${reset}" @@ -1430,7 +1461,7 @@ troubleshooting() { echo -e "\033]0;STL [TROUBLESHOOTING SUPPORT]\007" clear echo -e "${blue_fg_strong}| > / Home / Troubleshooting & Support |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| Troubleshooting & Repair Options |${reset}" echo " 1. Remove node_modules folder" @@ -1537,7 +1568,7 @@ switch_branch() { echo -e "\033]0;STL [SWITCH BRANCH]\007" clear echo -e "${blue_fg_strong}| > / Home / Toolbox / Switch Branch |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${yellow_fg_strong} ______________________________________________________________${reset}" echo -e "${yellow_fg_strong}| Version Status |${reset}" current_st_branch=$(git -C "$st_install_path" branch --show-current) @@ -1953,17 +1984,195 @@ install_ngrok() { app_installer_core_utilities } +install_tabbyapi_menu() { + # Check if the tabbyapi folder exists and deactivate Conda environment if necessary + if [[ -d "$tabbyapi_install_path" ]]; then + log_message "INFO" "Deactivating Conda environment: tabbyapi" + conda deactivate + fi + + clear + echo -e "${blue_fg_strong}| > / Home / Toolbox / App Installer / Text Completion / TabbyAPI |${reset}" + echo -e "${blue_fg_strong} =================================================================${reset}" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" + echo " 1. Install TabbyAPI" + echo " 2. Install ST-tabbyAPI-loader Extension" + echo " 3. Models [Install Options]" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| Menu Options: |${reset}" + echo " 0. Back" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| |${reset}" + read -p " Choose Your Destiny: " app_installer_tabbyapi_choice + echo + + # Handle user input + case "$app_installer_tabbyapi_choice" in + 1) + if [[ -f "$app_installer_text_completion_dir/install_tabbyapi.sh" ]]; then + bash "$app_installer_text_completion_dir/install_tabbyapi.sh" + install_tabbyapi_menu + else + log_message "ERROR" "install_tabbyapi.sh not found in: $app_installer_text_completion_dir" + read -p "Press Enter to continue..." + install_tabbyapi_menu + fi + ;; + 2) + if [[ -f "$app_installer_text_completion_dir/install_tabbyapi_st_ext.sh" ]]; then + bash "$app_installer_text_completion_dir/install_tabbyapi_st_ext.sh" + install_tabbyapi_menu + else + log_message "ERROR" "install_tabbyapi_st_ext.sh not found in: $app_installer_text_completion_dir" + read -p "Press Enter to continue..." + install_tabbyapi_menu + fi + ;; + 3) + bash "$app_installer_text_completion_dir/install_tabbyapi_model_menu.sh" + install_tabbyapi_menu + ;; + 0) + app_installer_text_completion + ;; + *) + log_message "ERROR" "Invalid input" + read -p "Press Enter to continue..." + install_tabbyapi_menu + ;; + esac +} + app_installer_text_completion() { - log_message "INFO" "coming soon" - read -p "Press Enter to continue..." - app_installer + echo -e "\033]0;STL [APP INSTALLER TEXT COMPLETION]\007" + clear + + echo -e "${blue_fg_strong}| > / Home / Toolbox / App Installer / Text Completion |${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" + + echo " 1. Install Text generation web UI oobabooga" + echo " 2. koboldcpp [Install options]" + echo " 3. TabbyAPI [Install options]" + echo " 4. Install llamacpp" + + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| Menu Options: |${reset}" + echo " 0. Back" + + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| |${reset}" + read -p " Choose Your Destiny: " app_installer_text_completion_choice + + case "$app_installer_text_completion_choice" in + 1) + if [[ -f "$app_installer_text_completion_dir/install_ooba.sh" ]]; then + bash "$app_installer_text_completion_dir/install_ooba.sh" + app_installer_text_completion + else + log_message "ERROR" "install_ooba.sh not found in: $app_installer_text_completion_dir" + read -p "Press Enter to continue..." + app_installer_text_completion + fi + ;; + 2) + install_koboldcpp_menu + ;; + 3) + install_tabbyapi_menu + ;; + 4) + if [[ -f "$app_installer_text_completion_dir/install_llamacpp.sh" ]]; then + bash "$app_installer_text_completion_dir/install_llamacpp.sh" + app_installer_text_completion + else + log_message "ERROR" "install_llamacpp.sh not found in: $app_installer_text_completion_dir" + read -p "Press Enter to continue..." + app_installer_text_completion + fi + ;; + 0) + app_installer + ;; + *) + log_message "ERROR" "Invalid input" + read -p "Press Enter to continue..." + app_installer_text_completion + ;; + esac } app_installer_voice_generation() { - log_message "INFO" "coming soon" - read -p "Press Enter to continue..." - app_installer + echo -e "\033]0;STL [APP INSTALLER VOICE GENERATION]\007" + clear + + echo -e "${blue_fg_strong}| > / Home / Toolbox / App Installer / Voice Generation |${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" + + echo " 1. Install AllTalk V2" + echo " 2. Install AllTalk" + echo " 3. Install XTTS" + echo " 4. Install RVC" + echo " 5. Install RVC-Python" + + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| Menu Options: |${reset}" + echo " 0. Back" + + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| |${reset}" + read -p " Choose Your Destiny: " app_installer_voice_generation_choice + + case "$app_installer_voice_generation_choice" in + 1) + if [[ -f "$app_installer_voice_generation_dir/install_alltalk_v2.sh" ]]; then + bash "$app_installer_voice_generation_dir/install_alltalk_v2.sh" + app_installer_voice_generation + else + log_message "ERROR" "install_alltalk_v2.sh not found in: $app_installer_voice_generation_dir" + read -p "Press Enter to continue..." + app_installer_voice_generation + fi + ;; + 2) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_installer_voice_generation + ;; + 3) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_installer_voice_generation + ;; + 4) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_installer_voice_generation + ;; + 5) + if [[ -f "$app_installer_voice_generation_dir/install_rvc_python.sh" ]]; then + bash "$app_installer_voice_generation_dir/install_rvc_python.sh" + app_installer_voice_generation + else + log_message "ERROR" "install_rvc_python.sh not found in: $app_installer_voice_generation_dir" + read -p "Press Enter to continue..." + app_installer_voice_generation + fi + ;; + 0) + app_installer + ;; + *) + log_message "ERROR" "Invalid input" + read -p "Press Enter to continue..." + app_installer_voice_generation + ;; + esac } app_installer_image_generation() { @@ -1977,7 +2186,7 @@ app_installer_core_utilities() { clear echo -e "${blue_fg_strong}| > / Home / Toolbox / App Installer / Core Utilities |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" @@ -2026,7 +2235,7 @@ app_installer() { echo -e "\033]0;STL [APP INSTALLER]\007" clear echo -e "${blue_fg_strong}| > / Home / Toolbox / App Installer |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" echo " 1. Text Completion" @@ -2540,21 +2749,323 @@ uninstall_ngrok() { } app_uninstaller_text_completion() { - log_message "INFO" "coming soon" - read -p "Press Enter to continue..." - app_installer + clear + echo -e "${blue_fg_strong}| > / Home / Toolbox / App Uninstaller / Text Completion |${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" + echo " 1. UNINSTALL Text generation web UI oobabooga" + echo " 2. UNINSTALL koboldcpp" + echo " 3. UNINSTALL TabbyAPI" + echo " 4. UNINSTALL llamacpp" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| Menu Options: |${reset}" + echo " 0. Back" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| |${reset}" + read -p " Choose Your Destiny: " app_uninstaller_text_completion_choice + echo + + # Handle user input + case "$app_uninstaller_text_completion_choice" in + 1) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_text_completion + + if [[ -f "$app_uninstaller_text_completion_dir/uninstall_ooba.sh" ]]; then + bash "$app_uninstaller_text_completion_dir/uninstall_ooba.sh" + app_uninstaller_text_completion + else + log_message "ERROR" "uninstall_ooba.sh not found in: $app_uninstaller_text_completion_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_text_completion + fi + ;; + 2) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_text_completion + + if [[ -f "$app_uninstaller_text_completion_dir/uninstall_koboldcpp.sh" ]]; then + bash "$app_uninstaller_text_completion_dir/uninstall_koboldcpp.sh" + app_uninstaller_text_completion + else + log_message "ERROR" "uninstall_koboldcpp.sh not found in: $app_uninstaller_text_completion_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_text_completion + fi + ;; + 3) + if [[ -f "$app_uninstaller_text_completion_dir/uninstall_tabbyapi.sh" ]]; then + bash "$app_uninstaller_text_completion_dir/uninstall_tabbyapi.sh" + app_uninstaller_text_completion + else + log_message "ERROR" "uninstall_tabbyapi.sh not found in: $app_uninstaller_text_completion_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_text_completion + fi + ;; + 4) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_text_completion + + if [[ -f "$app_uninstaller_text_completion_dir/uninstall_llamacpp.sh" ]]; then + bash "$app_uninstaller_text_completion_dir/uninstall_llamacpp.sh" + app_uninstaller_text_completion + else + log_message "ERROR" "uninstall_llamacpp.sh not found in: $app_uninstaller_text_completion_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_text_completion + fi + ;; + 0) + app_uninstaller + ;; + *) + log_message "ERROR" "Invalid input" + read -p "Press Enter to continue..." + app_uninstaller_text_completion + ;; + esac } app_uninstaller_voice_generation() { - log_message "INFO" "coming soon" - read -p "Press Enter to continue..." - app_installer + clear + echo -e "${blue_fg_strong}| > / Home / Toolbox / App Uninstaller / Voice Generation |${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" + echo " 1. UNINSTALL AllTalk V2" + echo " 2. UNINSTALL AllTalk" + echo " 3. UNINSTALL XTTS" + echo " 4. UNINSTALL RVC" + echo " 5. UNINSTALL RVC-Python" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| Menu Options: |${reset}" + echo " 0. Back" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| |${reset}" + read -p " Choose Your Destiny: " app_uninstaller_voice_generation_choice + echo + + # Handle user input + case "$app_uninstaller_voice_generation_choice" in + 1) + if [[ -f "$app_uninstaller_voice_generation_dir/uninstall_alltalk_v2.sh" ]]; then + bash "$app_uninstaller_voice_generation_dir/uninstall_alltalk_v2.sh" + app_uninstaller_voice_generation + else + log_message "ERROR" "uninstall_alltalk_v2.sh not found in: $app_uninstaller_voice_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + fi + ;; + 2) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + + if [[ -f "$app_uninstaller_voice_generation_dir/uninstall_alltalk.sh" ]]; then + bash "$app_uninstaller_voice_generation_dir/uninstall_alltalk.sh" + app_uninstaller_voice_generation + else + log_message "ERROR" "uninstall_alltalk.sh not found in: $app_uninstaller_voice_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + fi + ;; + 3) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + + if [[ -f "$app_uninstaller_voice_generation_dir/uninstall_xtts.sh" ]]; then + bash "$app_uninstaller_voice_generation_dir/uninstall_xtts.sh" + app_uninstaller_voice_generation + else + log_message "ERROR" "uninstall_xtts.sh not found in: $app_uninstaller_voice_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + fi + ;; + 4) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + + if [[ -f "$app_uninstaller_voice_generation_dir/uninstall_rvc.sh" ]]; then + bash "$app_uninstaller_voice_generation_dir/uninstall_rvc.sh" + app_uninstaller_voice_generation + else + log_message "ERROR" "uninstall_rvc.sh not found in: $app_uninstaller_voice_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + fi + ;; + 5) + if [[ -f "$app_uninstaller_voice_generation_dir/uninstall_rvc_python.sh" ]]; then + bash "$app_uninstaller_voice_generation_dir/uninstall_rvc_python.sh" + app_uninstaller_voice_generation + else + log_message "ERROR" "uninstall_rvc_python.sh not found in: $app_uninstaller_voice_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + fi + ;; + 0) + app_uninstaller + ;; + *) + log_message "ERROR" "Invalid input" + read -p "Press Enter to continue..." + app_uninstaller_voice_generation + ;; + esac } app_uninstaller_image_generation() { - log_message "INFO" "coming soon" - read -p "Press Enter to continue..." - app_uninstaller + clear + echo -e "${blue_fg_strong}| > / Home / Toolbox / App Uninstaller / Image Generation |${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" + echo " 1. UNINSTALL Stable Diffusion WebUI" + echo " 2. UNINSTALL Stable Diffusion WebUI Forge" + echo " 3. UNINSTALL ComfyUI" + echo " 4. UNINSTALL Fooocus" + echo " 5. UNINSTALL InvokeAI" + echo " 6. UNINSTALL Ostris AI Toolkit" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| Menu Options: |${reset}" + echo " 0. Back" + echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" + echo -e "${cyan_fg_strong}| |${reset}" + read -p " Choose Your Destiny: " app_uninstaller_image_generation_choice + echo + + # Handle user input + case "$app_uninstaller_image_generation_choice" in + 1) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_image_generation + + if [[ -f "$app_uninstaller_image_generation_dir/uninstall_sdwebui.sh" ]]; then + bash "$app_uninstaller_image_generation_dir/uninstall_sdwebui.sh" + app_uninstaller_image_generation + else + log_message "ERROR" "uninstall_sdwebui.sh not found in: $app_uninstaller_image_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_image_generation + fi + ;; + 2) + if [[ -f "$app_uninstaller_image_generation_dir/uninstall_sdwebuiforge.sh" ]]; then + bash "$app_uninstaller_image_generation_dir/uninstall_sdwebuiforge.sh" + app_uninstaller_image_generation + else + log_message "ERROR" "uninstall_sdwebuiforge.sh not found in: $app_uninstaller_image_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_image_generation + fi + ;; + 3) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_image_generation + + if [[ -f "$app_uninstaller_image_generation_dir/uninstall_comfyui.sh" ]]; then + bash "$app_uninstaller_image_generation_dir/uninstall_comfyui.sh" + app_uninstaller_image_generation + else + log_message "ERROR" "uninstall_comfyui.sh not found in: $app_uninstaller_image_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_image_generation + fi + ;; + 4) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_image_generation + + if [[ -f "$app_uninstaller_image_generation_dir/uninstall_fooocus.sh" ]]; then + bash "$app_uninstaller_image_generation_dir/uninstall_fooocus.sh" + app_uninstaller_image_generation + else + log_message "ERROR" "uninstall_fooocus.sh not found in: $app_uninstaller_image_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_image_generation + fi + ;; + 5) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_image_generation + + if [[ -f "$app_uninstaller_image_generation_dir/uninstall_invokeai.sh" ]]; then + bash "$app_uninstaller_image_generation_dir/uninstall_invokeai.sh" + app_uninstaller_image_generation + else + log_message "ERROR" "uninstall_invokeai.sh not found in: $app_uninstaller_image_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_image_generation + fi + ;; + 6) + log_message "INFO" "coming soon" + read -p "Press Enter to continue..." + app_uninstaller_image_generation + + if [[ -f "$app_uninstaller_image_generation_dir/uninstall_ostris_aitoolkit.sh" ]]; then + bash "$app_uninstaller_image_generation_dir/uninstall_ostris_aitoolkit.sh" + app_uninstaller_image_generation + else + log_message "ERROR" "uninstall_ostris_aitoolkit.sh not found in: $app_uninstaller_image_generation_dir" + log_message "INFO" "Running Automatic Repair..." + git pull + read -p "Press Enter to continue..." + app_uninstaller_image_generation + fi + ;; + 0) + app_uninstaller + ;; + *) + log_message "ERROR" "Invalid input" + read -p "Press Enter to continue..." + app_uninstaller_image_generation + ;; + esac } app_uninstaller_core_utilities() { @@ -2562,7 +3073,7 @@ app_uninstaller_core_utilities() { clear echo -e "${blue_fg_strong}| > / Home / Toolbox / App Uninstaller / Core Utilities |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" @@ -2614,7 +3125,7 @@ app_uninstaller() { echo -e "\033]0;STL [APP UNINSTALLER]\007" clear echo -e "${blue_fg_strong}| > / Home / Toolbox / App Uninstaller |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" echo " 1. Text Completion" @@ -2650,7 +3161,7 @@ toolbox() { echo -e "\033]0;STL [TOOLBOX]\007" clear echo -e "${blue_fg_strong}| > / Home / Toolbox |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" echo " 1. App Launcher" @@ -2825,12 +3336,32 @@ create_module_files() { # Function to check if Miniconda3 is installed check_miniconda() { - if ! command -v conda &> /dev/null; then + # Try to find Miniconda installation + miniconda_path=$(find_conda) + if [ $? -ne 0 ]; then log_message "WARN" "${yellow_fg_strong}Miniconda3 is not installed on this system.${reset}" log_message "INFO" "Please install Miniconda3 manually from https://docs.conda.io/en/latest/miniconda.html" - else - log_message "INFO" "${blue_fg_strong}Miniconda3 is already installed.${reset}" + return 1 fi + + # Source Conda initialization script + if [ -f "${miniconda_path}/etc/profile.d/conda.sh" ]; then + source "${miniconda_path}/etc/profile.d/conda.sh" + else + log_message "ERROR" "${red_fg_strong}Conda initialization script not found at ${miniconda_path}/etc/profile.d/conda.sh${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + # Check if conda command is available + if ! command -v conda &> /dev/null; then + log_message "ERROR" "${red_fg_strong}Conda command not available after initialization.${reset}" + log_message "INFO" "Please ensure Miniconda3 is properly installed from https://docs.conda.io/en/latest/miniconda.html" + return 1 + fi + + log_message "INFO" "${blue_fg_strong}Miniconda3 is installed at ${miniconda_path}${reset}" + return 0 } # Function to check if SillyTavern folder exists @@ -3084,7 +3615,7 @@ start_st_remotelink() { echo -e "\033]0;STL [ST REMOTE LINK]\007" clear echo -e "${blue_fg_strong}| > / Home / SillyTavern Remote Link |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" # Warning and confirmation prompt echo @@ -3172,7 +3703,7 @@ info_vram() { # Display header echo -e "${blue_fg_strong}| > / Home / VRAM & LLM Info |${reset}" - echo -e "${blue_fg_strong}======================================================================================================${reset}" + echo -e "${blue_fg_strong} ======================================================================================================${reset}" # Display GPU information echo -e "${cyan_fg_strong}GPU: $gpu_info${reset}" @@ -3242,7 +3773,7 @@ home() { echo -e "\033]0;STL [HOME]\007" clear echo -e "${blue_fg_strong}| > / Home |${reset}" - echo -e "${blue_fg_strong}==============================================================${reset}" + echo -e "${blue_fg_strong} ==============================================================${reset}" echo -e "${cyan_fg_strong} ______________________________________________________________${reset}" echo -e "${cyan_fg_strong}| What would you like to do? |${reset}" echo " 1. Update & Start SillyTavern" @@ -3312,7 +3843,7 @@ startup() { read_tailscale_status get_sillytavern_version node_version=$(node -v) - stl_version="24.1.0.0" + stl_version="25.1.0.0" update_status_st="Up to date" }