Welcome to FaceFusionCpp, the high-performance C++ implementation of the popular open-source project facefusion. This document will guide you through environment preparation, installation, and your first face-swapping operation.
Before downloading, please ensure your system meets the following requirements. FaceFusionCpp relies on NVIDIA CUDA for GPU acceleration.
- Linux x64 (Recommended, primary supported platform)
- Windows 10/11 x64 (Supported, recommended to use WSL2 or Bash environment)
- CLI: Currently the primary interaction method.
- WebUI: Coming soon, will provide an intuitive web-based interface.
- NVIDIA GPU: Required for high-performance inference.
- VRAM: Minimum 4GB. Strongly recommended 8GB+ for handling 1080p+ videos.
You must install the following components and add them to your system PATH, or place them in the executable's directory:
| Component | Required Version | Tested Version | Description |
|---|---|---|---|
| CUDA Toolkit | >= 12.2 | 12.8.1 | Required for GPU execution. |
| cuDNN | >= 9.2 | 9.19.0 | Required deep learning primitives. |
| TensorRT | >= 10.2 | 10.15.1 | Optional but highly recommended for peak velocity. |
Note: If you downloaded a pre-packaged Release, some dependencies (like FFmpeg) might already be bundled, or shipped with instructions on where to drop your DLLs. Ensure CUDA/cuDNN are properly installed on your system.
-
Download the Release Package: Proceed to our Releases page to download the latest
.zippackage for Windows. -
Unpack: Extract the ZIP archive into a directory (e.g.,
D:\FaceFusionCpp). Try to avoid paths incorporating non-ASCII characters or excessive spacing. -
Directory Structure: Once extracted, you should see the following structure:
FaceFusionCpp/ ├── bin/ # Executables and DLLs ├── models/ # AI model files (.onnx) ├── resources/ # Font files, overlays, and masks ├── FaceFusionCpp.exe # Main application └── ...
Let's execute a basic face-swapping operation to verify that everything is working.
- Prepare a Source Image (the face you wish to use). Let's assume it is named
source.jpg. - Prepare a Target Image (the picture you wish to overwrite). Let's assume it is named
target.jpg. - For convenience, place them directly inside the project root directory.
Open a terminal at the installation directory and run the command based on your OS:
Linux (Bash):
./FaceFusionCpp -s source.jpg -t target.jpg -o output.jpgWindows (PowerShell):
.\FaceFusionCpp.exe -s source.jpg -t target.jpg -o output.jpgParameter Explanation:
-s, --source: The source face image path.-t, --target: The target image or video path you're injecting into.-o, --output: The path to save the result.
You should witness the following scroll in the log:
- Device Initialization (CUDA/TensorRT).
- Model Loading (inswapper_128, etc.).
- Processing Progress.
- Completion Message.
Check output.jpg to view your result!
When encountering environmental problems or before kicking off your first massive run, it is highly recommended to fire off the built-in system checker. This utility rapidly diagnoses the dependencies of CUDA, TensorRT, your Models, and FFmpeg:
Linux (Bash):
./FaceFusionCpp --system-checkWindows (PowerShell):
.\FaceFusionCpp.exe --system-checkIf the application fails to start or crashes abruptly:
- "DLL not found": Ensure the
bindirectories for CUDA, cuDNN, and TensorRT have been added to your system PATH, or manually copy the required.dllfiles next toFaceFusionCpp.exe. - "CUDA error": Update your NVIDIA graphics card driver to the newest version.
- "Model not found": Ensure the
models/directory exists and houses the required.onnxfiles.
For a significantly more detailed explanation of configuration options, please refer to the User Guide or the CLI Reference.