Metadata-Version: 2.1
Name: facefusionlib
Version: 1.0.9
Summary: Face swapper and enhancer
Home-page: https://github.com/IAn2018cs/sd-webui-facefusion
Author: IAn2018
Author-email: ian2018cs@gmail.com
Keywords: face,swapper
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9, <3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: basicsr ==1.4.2
Requires-Dist: filetype ==1.2.0
Requires-Dist: numpy
Requires-Dist: onnx ==1.15.0
Requires-Dist: opencv-python ==4.8.1.78
Requires-Dist: realesrgan ==0.3.0
Requires-Dist: tqdm
Requires-Dist: onnxruntime
Requires-Dist: torch
Provides-Extra: gpu
Requires-Dist: onnxruntime-gpu ; extra == 'gpu'

# FaceFuison Python Lib

[FaceFusion](https://github.com/facefusion/facefusion) is a very nice face swapper and enhancer.

## Requirements
```
python: >=3.9
```

## Installation

CPU support:
```
pip install facefusionlib
```

GPU support:

First of all, you need to check if your system supports the `onnxruntime-gpu`.

Go to [https://onnxruntime.ai](https://onnxruntime.ai) and check the installation matrix.

![Preview](https://raw.githubusercontent.com/IAn2018cs/sd-webui-facefusion/dev/.github/onnxruntime-installation-matrix.png)

If yes, just run:

```
pip install facefusionlib[gpu]
```

## Usage

```python
from facefusionlib import swapper
from facefusionlib.swapper import DeviceProvider

input_path = 'input.png'
target_path = 'target.png'

result = swapper.swap_face(
		source_paths=[input_path],
		target_path=target_path,
		provider=DeviceProvider.CPU,
		detector_score=0.65,
		mask_blur=0.7,
		skip_nsfw=True
	)
print(result)
```
