FaceSwapAll / README.md
LogicGoInfotechSpaces's picture
Configure HuggingFace Space for FastAPI with Docker SDK
0e17006
metadata
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