This is a simple online face swapping solution, which is based on ACE++
All results can be found at faceswap/data/faceswaps
Pipeline consist of several main steps:
It's located under faceswap/preprocess/align.py.
Main logic is to detect face and landmarks. And after align face by eyes and lips landmarks. It utilizes RetinaFace and Landmark106 models from insight face. Also, there are option to use mediapipe as landmark model, but it produces lower quality of alignment (settings located at faceswap/preprocess/config.py)
Example of steps before and after:
Before:
After:
Before:
After:
Mask creation use landmarks to create mask from it
Before:
After:
Second step utilize ACE++ model based on the Flux.1 Fill
Comfy workflow with the same pipeline can be founded in faceswap/inpaint/workflow/Flux_ACE++.json
To improve naturalness and quality of face, solution utilize portrait lora and FLUX.1-Turbo-Alpha LoRa
Input:
Output:
Input:
Result:
- Install dependencies
pip install -e .-
Download checkpoints from https://drive.google.com/drive/folders/1MF_mTWnfui9yOcSk3Vsu44SayQ8kx_zu?usp=sharing
-
Place them in some folder
-
Set path to the folder with checkpoints in environment variable
export MODELS_DIR=<path_to_checkpoints>export PYTHONPATH=$PYTHONPATH:$(pwd)/faceswap/inpaint
python faceswap --source <source_image> --target <target_image> --output <output_image>







