@echo off REM AutoMosaRakku Triton Cache Prebuild Tool REM Creates Triton cache to prevent timeout during first object removal setlocal EnableDelayedExpansion chcp 65001 >nul 2>&1 REM Ensure working directory is the parent directory (distribution root) REM Create_Cache.bat is now in setup/ subdirectory, so we need to go up one level pushd "%~dp0.." REM Isolate from any system Python (same reason as Setup.bat) set PYTHONNOUSERSITE=1 set PYTHONPATH= echo. echo ======================================================== echo AutoMosaRakku Triton Cache Prebuild Tool echo ======================================================== echo. echo This tool creates Triton cache for object removal feature. echo Prevents long processing time and timeouts on first use. echo. echo Note: This process may take several minutes. echo. if not defined AUTOPILOT pause echo. echo [START] Starting Triton cache creation... echo. REM Configure MSVC environment (required for triton-windows) echo [CONFIG] Setting up MSVC environment... if exist "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" ( call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" >nul 2>&1 echo [OK] MSVC Build Tools environment configured ) else if exist "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" ( call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" >nul 2>&1 echo [OK] MSVC Community environment configured ) else ( echo [WARNING] MSVC not found. Please run Setup.bat first. ) REM Execute cache creation using secure launcher (handles encrypted files) echo. echo [EXEC] Running encrypted environment cache creation... echo Current directory: %CD% python_base\python.exe runtime\secure_launcher_v2.py --cache-only REM Check execution result if %errorlevel% equ 0 ( echo. echo ======================================================== echo [SUCCESS] Triton cache creation completed echo ======================================================== echo. echo Object removal processing will be faster next time. echo Start the application and try the object removal feature. echo. ) else ( echo. echo ======================================================== echo [FAILED] Triton cache creation failed echo ======================================================== echo. echo Troubleshooting: echo 1. Make sure Setup.bat has been executed and completed echo 2. Ensure NVIDIA GPU drivers are up to date echo 3. Run this batch file with administrator privileges echo. ) echo Cache directory check: if exist "%USERPROFILE%\.triton\cache" ( echo [OK] %USERPROFILE%\.triton\cache dir "%USERPROFILE%\.triton\cache" /b | find /c /v "" > nul if not errorlevel 1 ( for /f %%i in ('dir "%USERPROFILE%\.triton\cache" /b ^| find /c /v ""') do echo Cache files count: %%i ) ) else ( echo [INFO] Triton cache directory was not created ) echo. if not defined AUTOPILOT ( echo Batch execution completed. Press any key to exit... pause >nul ) REM Restore original directory popd