Files
flux1-edit/run.bat
2025-08-26 02:35:44 +09:00

75 lines
1.7 KiB
Batchfile

@echo off
echo Starting FLUX.1 Edit MCP Server...
echo ================================
REM Check if Python is available
python --version >nul 2>&1
if errorlevel 1 (
echo Error: Python is not installed or not in PATH
echo Please install Python 3.8 or higher
pause
exit /b 1
)
REM Check if virtual environment exists
if not exist "venv" (
echo Creating virtual environment...
python -m venv venv
if errorlevel 1 (
echo Error: Failed to create virtual environment
pause
exit /b 1
)
)
REM Activate virtual environment
echo Activating virtual environment...
call venv\Scripts\activate.bat
if errorlevel 1 (
echo Error: Failed to activate virtual environment
pause
exit /b 1
)
REM Install/upgrade dependencies
echo Installing dependencies...
pip install -r requirements.txt
if errorlevel 1 (
echo Error: Failed to install dependencies
pause
exit /b 1
)
REM Check if .env file exists
if not exist ".env" (
echo Warning: .env file not found
echo Please copy .env.example to .env and configure your FLUX_API_KEY
echo.
echo Creating .env from example...
copy .env.example .env
echo.
echo Please edit .env file and add your FLUX_API_KEY before running the server
pause
exit /b 1
)
REM Create directories if they don't exist
if not exist "input_images" mkdir input_images
if not exist "generated_images" mkdir generated_images
if not exist "temp" mkdir temp
echo.
echo Starting FLUX.1 Edit MCP Server...
echo Press Ctrl+C to stop the server
echo.
REM Run the server with UTF-8 encoding to prevent Unicode errors
chcp 65001 >nul 2>&1
set PYTHONIOENCODING=utf-8
set PYTHONUTF8=1
python main.py
echo.
echo Server stopped.
pause