@echo off
chcp 65001 > nul
cd /d "%~dp0"

if not exist "%~dp0python\python.exe" (
  echo [Error] Portable Python not found.
  echo         Please re-extract the ZIP.
  pause
  exit /b 1
)
if not exist "%~dp0realesrgan\realesrgan-ncnn-vulkan.exe" (
  echo [Error] Real-ESRGAN executable not found.
  echo         Please re-extract the ZIP.
  pause
  exit /b 1
)

echo ============================================================
echo  Ttalkkak Lab - Real-ESRGAN Portable Server
echo ============================================================
echo  Server URL : http://localhost:8765
echo  To stop    : Close this window or Ctrl+C
echo ============================================================
echo.

python\python.exe server.py

if errorlevel 1 (
  echo.
  echo [Error] Server crashed or failed to start.
  pause
)