# 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,
landmarker_score=0.5
)
print(result)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/IAn2018cs/sd-webui-facefusion",
"name": "facefusionlib",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.9",
"maintainer_email": null,
"keywords": "face, swapper",
"author": "IAn2018",
"author_email": "ian2018cs@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ef/96/f8e491b37d14311a8e7c60e6d352b7e5b36642936ac012fded65817f4576/facefusionlib-1.1.2.tar.gz",
"platform": null,
"description": "# FaceFuison Python Lib\n\n[FaceFusion](https://github.com/facefusion/facefusion) is a very nice face swapper and enhancer.\n\n## Requirements\n```\npython: >=3.9\n```\n\n## Installation\n\nCPU support:\n```\npip install facefusionlib\n```\n\nGPU support:\n\nFirst of all, you need to check if your system supports the `onnxruntime-gpu`.\n\nGo to [https://onnxruntime.ai](https://onnxruntime.ai) and check the installation matrix.\n\n![Preview](https://raw.githubusercontent.com/IAn2018cs/sd-webui-facefusion/dev/.github/onnxruntime-installation-matrix.png)\n\nIf yes, just run:\n\n```\npip install facefusionlib[gpu]\n```\n\n## Usage\n\n```python\nfrom facefusionlib import swapper\nfrom facefusionlib.swapper import DeviceProvider\n\ninput_path = 'input.png'\ntarget_path = 'target.png'\n\nresult = swapper.swap_face(\n\t\tsource_paths=[input_path],\n\t\ttarget_path=target_path,\n\t\tprovider=DeviceProvider.CPU,\n\t\tdetector_score=0.65,\n\t\tmask_blur=0.7,\n\t\tskip_nsfw=True,\n landmarker_score=0.5\n\t)\nprint(result)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Face swapper and enhancer",
"version": "1.1.2",
"project_urls": {
"Homepage": "https://github.com/IAn2018cs/sd-webui-facefusion"
},
"split_keywords": [
"face",
" swapper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7ba5123adbf5131d3d2015dfc9ef91acba5a58ee133723dc5271acddd0861f42",
"md5": "ff7099457ab5751b33a0463c764209a2",
"sha256": "e8ce5937d838530cdfad47baae2813f4d095d803eaa494c00880bc26fcee3ed8"
},
"downloads": -1,
"filename": "facefusionlib-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ff7099457ab5751b33a0463c764209a2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.9",
"size": 45369,
"upload_time": "2024-03-21T03:18:47",
"upload_time_iso_8601": "2024-03-21T03:18:47.368848Z",
"url": "https://files.pythonhosted.org/packages/7b/a5/123adbf5131d3d2015dfc9ef91acba5a58ee133723dc5271acddd0861f42/facefusionlib-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ef96f8e491b37d14311a8e7c60e6d352b7e5b36642936ac012fded65817f4576",
"md5": "c2aa4d7a2a0a932cd94ffacbacc4e98b",
"sha256": "7751f1770cf5aabccc61cd2aad1191936b9e961f5e41c0655f521800132f32fd"
},
"downloads": -1,
"filename": "facefusionlib-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "c2aa4d7a2a0a932cd94ffacbacc4e98b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.9",
"size": 33504,
"upload_time": "2024-03-21T03:18:49",
"upload_time_iso_8601": "2024-03-21T03:18:49.610046Z",
"url": "https://files.pythonhosted.org/packages/ef/96/f8e491b37d14311a8e7c60e6d352b7e5b36642936ac012fded65817f4576/facefusionlib-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-21 03:18:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "IAn2018cs",
"github_project": "sd-webui-facefusion",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "facefusionlib",
"specs": [
[
"==",
"1.1.2"
]
]
}
],
"lcname": "facefusionlib"
}