update launcher

added ability to install stable difussion webui forge NEO
This commit is contained in:
deffcolony
2025-12-26 17:28:53 +01:00
parent 2433e33eeb
commit ec4e012342
6 changed files with 888 additions and 45 deletions

View File

@@ -0,0 +1,45 @@
@echo off
:install_sdwebuiforgeneo
title STL [INSTALL SDWEBUI FORGE-NEO]
cls
echo %blue_fg_strong%/ Home / Toolbox / App Installer / Image Generation / Install Forge-NEO%reset%
echo -------------------------------------------------------------
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing Forge-NEO via Pixi...
if not exist "%image_generation_dir%" mkdir "%image_generation_dir%"
cd /d "%image_generation_dir%"
set max_retries=3
set retry_count=0
:retry_clone
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Cloning Forge-NEO branch...
git clone -b neo https://github.com/Haoming02/sd-webui-forge-classic.git stable-diffusion-webui-forge-neo
if %errorlevel% neq 0 (
set /A retry_count+=1
echo %yellow_bg%[%time%]%reset% %yellow_fg_strong%[WARN] Retry %retry_count% of %max_retries%%reset%
if %retry_count% lss %max_retries% goto :retry_clone
pause
goto :home
)
cd /d "%sdwebuiforgeneo_install_path%"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Creating Pixi configuration...
(
echo [workspace]
echo name = "forge-neo"
echo channels = ["conda-forge", "pytorch", "nvidia"]
echo platforms = ["win-64"]
echo.
echo [dependencies]
echo python = "3.11.9.*"
echo uv = "*"
) > pixi.toml
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Running Pixi Install (Environment Setup)...
call pixi install
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%Forge-NEO installed Successfully.%reset%
pause
goto :home

View File

@@ -0,0 +1,29 @@
@echo off
:start_sdwebuiforgeneo
cd /d "%sdwebuiforgeneo_install_path%"
REM Check if pixi exists
pixi --version >nul 2>&1
if %errorlevel% neq 0 (
echo %red_bg%[ERROR] Pixi not found. Please install Pixi first.%reset%
pause
goto :home
)
set "sdwfn_start_command="
for /F "tokens=*" %%a in ('findstr /I "sdwfn_start_command=" "%sdwebuiforgeneo_modules_path%"') do (
set "%%a"
)
if not defined sdwfn_start_command (
echo %yellow_fg_strong%[WARN] No modules configured. Redirecting to Editor...%reset%
pause
call "%editor_image_generation_dir%\edit_sdwebuiforgeneo_modules.bat"
goto :start_sdwebuiforgeneo
)
set "sdwfn_start_command=%sdwfn_start_command:sdwfn_start_command=%"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Launching Forge-NEO via Pixi...
start cmd /k "title FORGE-NEO && cd /d %sdwebuiforgeneo_install_path% && %sdwfn_start_command%"
goto :home

View File

@@ -0,0 +1,25 @@
@echo off
:uninstall_sdwebuiforgeneo
title STL [UNINSTALL SDWEBUI FORGE-NEO]
setlocal enabledelayedexpansion
chcp 65001 > nul
echo.
echo %red_bg%╔════ DANGER ZONE ══════════════════════════════════════════════════════════════════════════════╗%reset%
echo %red_bg%║ WARNING: This will delete all Forge-NEO data and its Pixi environment. ║%reset%
echo %red_bg%║ If you want to keep any data, make sure to create a backup before proceeding. ║%reset%
echo %red_bg%╚═══════════════════════════════════════════════════════════════════════════════════════════════╝%reset%
echo.
set /p "confirmation=Are you sure you want to proceed? [Y/N]: "
if /i "%confirmation%"=="Y" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Removing directory: %sdwebuiforgeneo_install_path%
if exist "%sdwebuiforgeneo_install_path%" rmdir /s /q "%sdwebuiforgeneo_install_path%"
echo %blue_bg%[%time%]%reset% %green_fg_strong%Forge-NEO has been uninstalled.%reset%
pause
goto :home
) else (
echo Uninstall canceled.
pause
goto :home
)

View File

@@ -0,0 +1,134 @@
@echo off
REM ############################################################
REM ############## EDIT FORGE-NEO MODULES - FRONTEND ###########
REM ############################################################
:edit_sdwebuiforgeneo_modules
title STL [EDIT FORGE-NEO MODULES]
cls
echo %blue_fg_strong%^| ^> / Home / Toolbox / Editor / Image Generation / Forge NEO Modules ^|%reset%
echo %blue_fg_strong% =========================================================================%reset%
echo Choose modules to enable or disable (e.g., "1 3 5" to toggle UV, Sage, and Cuda-Malloc)
echo %cyan_fg_strong% ______________________________________________________________%reset%
echo %cyan_fg_strong%^| Performance ^|%reset%
call :printModule "1. Use UV (Recommended) " %sdwfn_uv_trigger%
call :printModule "2. Xformers Attention " %sdwfn_xformers_trigger%
call :printModule "3. Sage Attention (Neo) " %sdwfn_sage_trigger%
call :printModule "4. Flash Attention (Neo) " %sdwfn_flash_trigger%
call :printModule "5. CUDA Malloc (Optimized) " %sdwfn_cudamalloc_trigger%
call :printModule "6. CUDA Stream " %sdwfn_cudastream_trigger%
call :printModule "7. Fast FP16 " %sdwfn_fastfp16_trigger%
echo %cyan_fg_strong% ______________________________________________________________%reset%
echo %cyan_fg_strong%^| VRAM / Memory Management ^|%reset%
call :printModule "8. Always High VRAM " %sdwfn_highvram_trigger%
call :printModule "9. Always Low VRAM " %sdwfn_lowvram_trigger%
call :printModule "10. BitsAndBytes (4-bit) " %sdwfn_bnb_trigger%
echo %cyan_fg_strong% ______________________________________________________________%reset%
echo %cyan_fg_strong%^| Server ^& UI ^|%reset%
call :printModule "11. Auto-Launch Browser " %sdwfn_autolaunch_trigger%
call :printModule "12. Enable API " %sdwfn_api_trigger%
call :printModule "13. Listen (LAN Access) " %sdwfn_listen_trigger%
call :printModule "14. Custom Port (7900) " %sdwfn_port_trigger%
call :printModule "15. Theme: Dark " %sdwfn_themedark_trigger%
echo %cyan_fg_strong% ______________________________________________________________%reset%
echo %cyan_fg_strong%^| Menu Options: ^|%reset%
echo 00. Save and Quick Start Forge NEO
echo 0. Back
echo %cyan_fg_strong% ______________________________________________________________%reset%
echo %cyan_fg_strong%^| ^|%reset%
:: Define a variable containing a single backspace character
for /f %%A in ('"prompt $H &echo on &for %%B in (1) do rem"') do set "BS=%%A"
:: Set the prompt with spaces
set /p "sdwfn_choice=%BS% Choose Your Destiny: "
REM Handle choices
for %%i in (%sdwfn_choice%) do (
if "%%i"=="1" ( if "!sdwfn_uv_trigger!"=="true" (set "sdwfn_uv_trigger=false") else (set "sdwfn_uv_trigger=true") )
if "%%i"=="2" ( if "!sdwfn_xformers_trigger!"=="true" (set "sdwfn_xformers_trigger=false") else (set "sdwfn_xformers_trigger=true") )
if "%%i"=="3" ( if "!sdwfn_sage_trigger!"=="true" (set "sdwfn_sage_trigger=false") else (set "sdwfn_sage_trigger=true") )
if "%%i"=="4" ( if "!sdwfn_flash_trigger!"=="true" (set "sdwfn_flash_trigger=false") else (set "sdwfn_flash_trigger=true") )
if "%%i"=="5" ( if "!sdwfn_cudamalloc_trigger!"=="true" (set "sdwfn_cudamalloc_trigger=false") else (set "sdwfn_cudamalloc_trigger=true") )
if "%%i"=="6" ( if "!sdwfn_cudastream_trigger!"=="true" (set "sdwfn_cudastream_trigger=false") else (set "sdwfn_cudastream_trigger=true") )
if "%%i"=="7" ( if "!sdwfn_fastfp16_trigger!"=="true" (set "sdwfn_fastfp16_trigger=false") else (set "sdwfn_fastfp16_trigger=true") )
if "%%i"=="8" ( if "!sdwfn_highvram_trigger!"=="true" (set "sdwfn_highvram_trigger=false") else (set "sdwfn_highvram_trigger=true") )
if "%%i"=="9" ( if "!sdwfn_lowvram_trigger!"=="true" (set "sdwfn_lowvram_trigger=false") else (set "sdwfn_lowvram_trigger=true") )
if "%%i"=="10" ( if "!sdwfn_bnb_trigger!"=="true" (set "sdwfn_bnb_trigger=false") else (set "sdwfn_bnb_trigger=true") )
if "%%i"=="11" ( if "!sdwfn_autolaunch_trigger!"=="true" (set "sdwfn_autolaunch_trigger=false") else (set "sdwfn_autolaunch_trigger=true") )
if "%%i"=="12" ( if "!sdwfn_api_trigger!"=="true" (set "sdwfn_api_trigger=false") else (set "sdwfn_api_trigger=true") )
if "%%i"=="13" ( if "!sdwfn_listen_trigger!"=="true" (set "sdwfn_listen_trigger=false") else (set "sdwfn_listen_trigger=true") )
if "%%i"=="14" ( if "!sdwfn_port_trigger!"=="true" (set "sdwfn_port_trigger=false") else (set "sdwfn_port_trigger=true") )
if "%%i"=="15" ( if "!sdwfn_themedark_trigger!"=="true" (set "sdwfn_themedark_trigger=false") else (set "sdwfn_themedark_trigger=true") )
if "%%i"=="00" (
set "caller=app_launcher_image_generation"
if exist "%app_launcher_image_generation_dir%\start_sdwebuiforgeneo.bat" (
call %app_launcher_image_generation_dir%\start_sdwebuiforgeneo.bat
goto :home
) else (
echo [%DATE% %TIME%] ERROR: start_sdwebuiforgeneo.bat not found in: app_launcher_image_generation_dir% >> %logs_stl_console_path%
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] start_sdwebuiforgeneo.bat not found in: %app_launcher_image_generation_dir%%reset%
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Running Automatic Repair...
git pull
pause
goto :edit_sdwebuiforgeneo_modules
)
)
if "%%i"=="0" ( goto :editor_image_generation )
)
:save_config
REM Save module flags
(
echo sdwfn_uv_trigger=%sdwfn_uv_trigger%
echo sdwfn_xformers_trigger=%sdwfn_xformers_trigger%
echo sdwfn_sage_trigger=%sdwfn_sage_trigger%
echo sdwfn_flash_trigger=%sdwfn_flash_trigger%
echo sdwfn_cudamalloc_trigger=%sdwfn_cudamalloc_trigger%
echo sdwfn_cudastream_trigger=%sdwfn_cudastream_trigger%
echo sdwfn_fastfp16_trigger=%sdwfn_fastfp16_trigger%
echo sdwfn_highvram_trigger=%sdwfn_highvram_trigger%
echo sdwfn_lowvram_trigger=%sdwfn_lowvram_trigger%
echo sdwfn_bnb_trigger=%sdwfn_bnb_trigger%
echo sdwfn_autolaunch_trigger=%sdwfn_autolaunch_trigger%
echo sdwfn_api_trigger=%sdwfn_api_trigger%
echo sdwfn_listen_trigger=%sdwfn_listen_trigger%
echo sdwfn_port_trigger=%sdwfn_port_trigger%
echo sdwfn_themedark_trigger=%sdwfn_themedark_trigger%
) > "%sdwebuiforgeneo_modules_path%"
REM Build the Pixi command
set "python_command=pixi run python launch.py"
if "%sdwfn_uv_trigger%"=="true" set "python_command=%python_command% --uv"
if "%sdwfn_xformers_trigger%"=="true" set "python_command=%python_command% --xformers"
if "%sdwfn_sage_trigger%"=="true" set "python_command=%python_command% --sage"
if "%sdwfn_flash_trigger%"=="true" set "python_command=%python_command% --flash"
if "%sdwfn_cudamalloc_trigger%"=="true" set "python_command=%python_command% --cuda-malloc"
if "%sdwfn_cudastream_trigger%"=="true" set "python_command=%python_command% --cuda-stream"
if "%sdwfn_fastfp16_trigger%"=="true" set "python_command=%python_command% --fast-fp16"
if "%sdwfn_highvram_trigger%"=="true" set "python_command=%python_command% --always-high-vram"
if "%sdwfn_lowvram_trigger%"=="true" set "python_command=%python_command% --always-low-vram"
if "%sdwfn_bnb_trigger%"=="true" set "python_command=%python_command% --bnb"
if "%sdwfn_autolaunch_trigger%"=="true" set "python_command=%python_command% --autolaunch"
if "%sdwfn_api_trigger%"=="true" set "python_command=%python_command% --api"
if "%sdwfn_listen_trigger%"=="true" set "python_command=%python_command% --listen"
if "%sdwfn_port_trigger%"=="true" set "python_command=%python_command% --port 7900"
if "%sdwfn_themedark_trigger%"=="true" set "python_command=%python_command% --theme dark"
echo sdwfn_start_command=%python_command% >> "%sdwebuiforgeneo_modules_path%"
goto :edit_sdwebuiforgeneo_modules
:printModule
if "%2"=="true" (
echo %1 [%green_fg_strong%Enabled%reset%]
) else (
echo %1 [%red_fg_strong%Disabled%reset%]
)
exit /b

View File

@@ -0,0 +1,174 @@
#!/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"
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}"
}
start_tabbyapi() {
# Read modules-tabbyapi and find the tabbyapi_start_command line
tabbyapi_start_command=$(grep -E "^tabbyapi_start_command=" "$tabbyapi_modules_path" | cut -d'=' -f2-)
if [[ -z "$tabbyapi_start_command" ]]; then
log_message "ERROR" "No modules enabled."
echo -e "${RED_BG}Please make sure you enabled at least one of the modules from Edit tabbyapi Modules.${RESET}"
echo
echo -e "${BLUE_BG}We will redirect you to the Edit tabbyapi Modules menu.${RESET}"
read -p "Press Enter to continue..."
if [[ -f "$editor_text_completion_dir/edit_tabbyapi_modules.sh" ]]; then
bash "$editor_text_completion_dir/edit_tabbyapi_modules.sh"
exit
else
log_message "ERROR" "edit_tabbyapi_modules.sh not found in: $editor_text_completion_dir"
log_message "INFO" "Running Automatic Repair..."
git pull
read -p "Press Enter to continue..."
exit
fi
exit 0
fi
# Activate the Miniconda installation
log_message "INFO" "Activating Miniconda environment..."
source "${miniconda_path}/etc/profile.d/conda.sh"
# Activate the tabbyapi environment
log_message "INFO" "Activating Conda environment: tabbyapi"
conda activate tabbyapi
# Start TabbyAPI with desired configurations in a new terminal
log_message "INFO" "TabbyAPI launched in a new window."
cd "$tabbyapi_install_path" || {
log_message "ERROR" "Failed to change to directory: $tabbyapi_install_path"
read -p "Press Enter to continue..."
exit
}
# Use xterm to open a new terminal window for TabbyAPI (alternative terminals like gnome-terminal or konsole can be used)
xterm -T "TabbyAPI" -e "bash -c '$tabbyapi_start_command; exec bash'" &
# Return to the launcher menu
exit
}
# Execute the start function
start_tabbyapi