File size: 1,031 Bytes
7cdf7d9
 
 
 
 
0e17006
7cdf7d9
0e17006
7cdf7d9
 
 
 
 
5f12d8e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
title: FaceSwapAll
emoji: 🏆
colorFrom: green
colorTo: indigo
sdk: docker
sdk_version: 5.29.0
app_file: Dockerfile
pinned: false
license: unknown
short_description: 'All-in-one face swapping: single photo, video, multi-source,'
---

## Run locally (FastAPI)

1. Install deps:
   - `python3 -m pip install -r requirements.txt`
2. (Optional) set API key:
   - `export FACE_SWAP_API_KEY=your_key`
3. Start server:
   - `python3 -m uvicorn fastapi_app:app --host 0.0.0.0 --port 8000`

Endpoints:
- `GET /health`
- `POST /swap/photo` (multipart form: `source_image`, `destination_image`, optional `source_face_idx`, `destination_face_idx`)
- `POST /swap/video` (multipart form: `source_image`, `target_video`, optional indices)
Include header `X-API-Key` if `FACE_SWAP_API_KEY` is set.

## Docker

Build:
- `docker build -t faceswapall .`

Run:
- `docker run -p 8000:8000 -e FACE_SWAP_API_KEY=your_key faceswapall`

## Original Gradio app

The space still includes `app.py` for the Gradio UI; run with:
- `python3 app.py --share`