@echo off title Face LoRA Console set "PATH=%SystemRoot%\System32;%SystemRoot%;%PATH%" set "PY=M:\AI\sd\musubi-tuner\.venv\Scripts\python.exe" set "GUI=%~dp0tools\caption_gui.py" set "URL=http://127.0.0.1:7860" echo ============================================ echo Face LoRA Console (fusion/material/label/train) echo ============================================ netstat -ano | findstr ":7860" | findstr "LISTENING" >nul 2>&1 if %errorlevel%==0 ( echo [INFO] Console already running. Opening browser... start "" %URL% exit /b 0 ) echo [START] Launching console (first start ~1-2 min)... echo [LOG] Look for the "Face LoRA Console" window on screen (keep it open, closing it stops GUI) start "Face LoRA Console" "%PY%" "%GUI%" set /a tries=0 :wait_loop netstat -ano | findstr ":7860" | findstr "LISTENING" >nul 2>&1 if %errorlevel%==0 goto ready set /a tries+=1 if %tries% geq 150 goto timeout timeout /t 1 /nobreak >nul goto wait_loop :ready echo [OK] Console ready. Opening browser... echo [HINT] The "Face LoRA Console" window = live terminal (real-time logs) start "" %URL% exit /b 0 :timeout echo [WARN] Startup timeout (150s). Check GPU/RAM or port 7860. pause exit /b 1