- Node.js & npm
- Python 3.8+
- All dependencies listed in
package.jsonandrequirements.txt - Download
inswapper_128.onnxmodel tobackend/models/
- Install frontend dependencies:
npm install
- Install backend dependencies:
cd backend pip install -r requirements.txt - Start backend server:
cd backend FLASK_APP=api.py flask run --host=0.0.0.0 --port=5555 - Start frontend dev server:
npm run dev
- Open the app in your browser at
http://localhost:5173
- For production, build the frontend and deploy to GitHub Pages or similar.
- Backend must be running for swaps to work.
-
Build and run containers for backend and frontend:
# Build backend container docker build -t faceswap-backend ./backend docker run -p 5555:5555 faceswap-backend # Build frontend container docker build -t faceswap-ui . docker run -p 80:80 faceswap-ui
-
See Makefile for automated commands.
- Swagger UI (when backend is running)
- OpenAPI Spec
The frontend uses the VITE_BACKEND_URL environment variable to set the backend API URL. Default is http://localhost:5555.
To use a different backend URL, create a .env file in the project root:
VITE_BACKEND_URL=https://your-backend-url.comOr set it in your shell before running:
export VITE_BACKEND_URL=https://your-backend-url.com
npm run dev