diff --git a/Launcher.bat b/Launcher.bat index 18a6452..a891969 100644 --- a/Launcher.bat +++ b/Launcher.bat @@ -1940,6 +1940,7 @@ echo 2. Start Stable Diffusion WebUI Forge echo 3. Start ComfyUI echo 4. Start Fooocus echo 5. Start InvokeAI +echo 6. Start Ostris AI Toolkit echo %cyan_fg_strong% ______________________________________________________________%reset% echo %cyan_fg_strong%^| Menu Options: ^|%reset% echo 0. Back @@ -2008,6 +2009,19 @@ if "%app_launcher_image_generation_choice%"=="1" ( pause goto :home ) +) else if "%app_launcher_image_generation_choice%"=="6" ( + set "caller=app_launcher_image_generation" + if exist "%app_launcher_image_generation_dir%\start_ostrisaitoolkit_nextjs.bat" ( + call %app_launcher_image_generation_dir%\start_ostrisaitoolkit_nextjs.bat + goto :home + ) else ( + echo [%DATE% %TIME%] ERROR: start_ostrisaitoolkit_nextjs.bat not found in: app_launcher_image_generation_dir% >> %logs_stl_console_path% + echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] start_ostrisaitoolkit_nextjs.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 :home + ) ) else if "%app_launcher_image_generation_choice%"=="0" ( goto :app_launcher ) else ( diff --git a/bin/functions/Toolbox/App_Installer/Image_Generation/install_comfyui.bat b/bin/functions/Toolbox/App_Installer/Image_Generation/install_comfyui.bat index ca4d703..fedf0b0 100644 --- a/bin/functions/Toolbox/App_Installer/Image_Generation/install_comfyui.bat +++ b/bin/functions/Toolbox/App_Installer/Image_Generation/install_comfyui.bat @@ -64,6 +64,93 @@ curl -o 4x-AnimeSharp.pth https://huggingface.co/konohashinobi4/4xAnimesharp/res curl -o 4x-UltraSharp.pth https://huggingface.co/lokCX/4x-Ultrasharp/resolve/main/4x-UltraSharp.pth +set TRITON_URL=https://github.com/woct0rdho/triton-windows/releases/download/v3.2.0-windows.post10/triton-3.2.0-cp312-cp312-win_amd64.whl +set INCLUDE_LIBS_URL=https://github.com/woct0rdho/triton-windows/releases/download/v3.0.0-windows.post1/python_3.12.7_include_libs.zip +set PYTHONUTF8=1 +set PYTHONIOENCODING=utf-8 + + + +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Checking Visual Studio Build Tools... +winget list --id Microsoft.VisualStudio.2022.BuildTools --source winget >nul 2>&1 +if %errorlevel% neq 0 ( + echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing Visual Studio Build Tools... + winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--quiet --wait --norestart --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.20348" + if %errorlevel% neq 0 ( + echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Failed to install Visual Studio Build Tools.%reset% + pause + exit /b + ) +) else ( + echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Visual Studio Build Tools already installed. +) + +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Activating Conda environment %cyan_fg_strong%comfyui%reset% +call conda activate comfyui +if %errorlevel% neq 0 ( + echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Failed to activate comfyui environment.%reset% + pause + exit /b +) + +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Using python from: %cyan_fg_strong%%CONDA_PREFIX%\python.exe%reset% + +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing PyTorch with CUDA aaaa support... +pip install torch==2.7.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126 +if %errorlevel% neq 0 ( + echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Failed to install PyTorch.%reset% + pause + exit /b +) + +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing Triton... +pip install "%TRITON_URL%" +if %errorlevel% neq 0 ( + echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Failed to install Triton.%reset% + pause + exit /b +) + +for %%F in ("%INCLUDE_LIBS_URL%") do set FILE_NAME=%%~nxF +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Downloading and extracting Python include/libs for Triton... +curl -L -o "%FILE_NAME%" "%INCLUDE_LIBS_URL%" && tar -xf "%FILE_NAME%" -C "%CONDA_PREFIX%" +if %errorlevel% neq 0 ( + echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Failed to setup Python headers/libs for Triton.%reset% + del "%FILE_NAME%" >nul 2>&1 + pause + exit /b +) + +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Cloning SageAttention repository... +git clone https://github.com/thu-ml/SageAttention.git +if %errorlevel% neq 0 ( + echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Failed to clone SageAttention repository.%reset% + pause + exit /b +) + +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing SageAttention... +pushd SageAttention +pip install --no-build-isolation . +set SAGE_INSTALL_ERROR=%errorlevel% +popd + +if %SAGE_INSTALL_ERROR% neq 0 ( + echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Failed to install SageAttention.%reset% + echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Cleaning up temporary files... + del "%FILE_NAME%" >nul 2>&1 + rmdir /s /q "SageAttention" >nul 2>&1 + pause + exit /b +) + +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Cleaning up temporary files... +del "%FILE_NAME%" +rmdir /s /q "SageAttention" + +echo. +echo %blue_bg%[%time%]%reset% %green_fg_strong%Triton and SageAttention successfully installed for ComfyUI.%reset% + echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%ComfyUI successfully installed.%reset% pause goto :app_installer_image_generation \ No newline at end of file diff --git a/bin/functions/Toolbox/App_Launcher/Image_Generation/start_ostrisaitoolkit_nextjs.bat b/bin/functions/Toolbox/App_Launcher/Image_Generation/start_ostrisaitoolkit_nextjs.bat new file mode 100644 index 0000000..a12c4c6 --- /dev/null +++ b/bin/functions/Toolbox/App_Launcher/Image_Generation/start_ostrisaitoolkit_nextjs.bat @@ -0,0 +1,10 @@ +@echo off + +:start_ostrisaitoolkit +cd /d "%ostrisaitoolkit_install_path%" + +REM Start ostrisaitoolkit +echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% ostrisaitoolkit launched in a new window. + +start cmd /k "title Ostris AI Toolkit && cd /d %ostrisaitoolkit_install_path%/ui && npm run build_and_start" +goto :home \ No newline at end of file