Metadata-Version: 2.4
Name: Face-Swaper-King
Version: 0.1.0
Summary: High-quality face swap for images and videos with GFPGAN enhancement.
Author: Raja Kushal
License-Expression: MIT
Project-URL: Homepage, https://pypi.org/project/Face-Swaper-King/
Keywords: face-swap,insightface,inswapper,gfpgan,video,image
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: insightface>=0.7.3
Requires-Dist: onnxruntime>=1.16.0
Requires-Dist: opencv-python>=4.8.0
Requires-Dist: numpy>=1.24.0
Provides-Extra: video
Requires-Dist: imageio-ffmpeg>=0.4.9; extra == "video"
Dynamic: license-file

# Face-Swaper-King

High-quality face swap for images and videos using InsightFace InSwapper and optional GFPGAN enhancement.

On first run the package downloads the required models automatically:

- Buffalo_L face detector
- InSwapper
- GFPGAN v1.4 (when enhancement is enabled)

## Install

```bash
pip install Face-Swaper-King
```

To let the tool fall back to a bundled ffmpeg binary when system ffmpeg is missing:

```bash
pip install "Face-Swaper-King[video]"
```

System `ffmpeg` is still recommended if you want the original audio copied onto swapped videos.

## Command line

```bash
face-swaper-king --source face.png --target photo.png --output swapped.png
face-swaper-king --source face.png --target clip.mp4 --output swapped.mp4
face-swaper-king --source face.png --target clip.mp4 --output swapped.mp4 --no-enhance
```

You can also run the module directly:

```bash
python -m face_swaper_king --source face.png --target photo.png --output swapped.png
```

## Python API

```python
from face_swaper_king import swap

swap("face.png", "photo.png", "swapped.png")
swap("face.png", "clip.mp4", "swapped.mp4", enhance=True)
```

For more control, load the models once and reuse them:

```python
from face_swaper_king import (
    load_face_analyzer,
    load_gfpgan,
    load_swapper,
    swap_image,
    swap_video,
)

app = load_face_analyzer()
swapper = load_swapper()
gfpgan = load_gfpgan()

swap_image(app, swapper, "face.png", "photo.png", "swapped.png", gfpgan=gfpgan)
```

## Requirements

- Python 3.9 or newer
- CPU is used by default (works on Apple Silicon and other machines)
- First run needs internet access to download models

Use this only on photos and videos you have the right to edit.
