Files
AI-Video/packaging/windows/templates/start_api.bat
2025-11-09 21:05:25 +08:00

46 lines
1.3 KiB
Batchfile

@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
echo ========================================
echo Pixelle-Video - API Server Launcher
echo ========================================
echo.
:: Set environment variables
set "PYTHON_HOME=%~dp0python\python311"
set "PATH=%PYTHON_HOME%;%PYTHON_HOME%\Scripts;%~dp0tools\ffmpeg\bin;%PATH%"
set "PROJECT_ROOT=%~dp0Pixelle-Video"
:: Change to project directory
cd /d "%PROJECT_ROOT%"
:: Set PYTHONPATH to project root for module imports
set "PYTHONPATH=%PROJECT_ROOT%"
:: Set PIXELLE_VIDEO_ROOT environment variable for reliable path resolution
set "PIXELLE_VIDEO_ROOT=%PROJECT_ROOT%"
:: Start API Server
echo [Starting] Launching Pixelle-Video API Server...
echo API will be available at: http://localhost:8000
echo API Documentation: http://localhost:8000/docs
echo.
echo Note: Configure API keys and settings in the Web UI.
echo Press Ctrl+C to stop the server
echo ========================================
echo.
"%PYTHON_HOME%\python.exe" -m uvicorn api.app:app --host 0.0.0.0 --port 8000
if errorlevel 1 (
echo.
echo [ERROR] Failed to start. Please check:
echo 1. Python is properly installed
echo 2. Dependencies are installed
echo 3. Port 8000 is not already in use
echo.
pause
)