Logo for AiToolGo

FaceFusion AI Face Swap Guide: Settings, Masks, and Advanced Techniques

In-depth discussion
Easy to understand
 0
 0
 1
本文介绍新一代AI换脸工具FaceFusion的使用方法,基于Gradio界面讲解主要参数设置,包括单张人脸替换流程、视频换脸及人脸选择模式、三种遮罩功能(Box、occlusion、region)的使用技巧,以及高清视频和卡通人脸替换的参数调整方法。内容以操作指引为主,配有参数说明和演示视频。
  • main points
  • unique insights
  • practical applications
  • key topics
  • key insights
  • learning outcomes
  • • main points

    • 1
      逐项解释Gradio界面中FaceSwap、Face_enhancer、Face Swapper Model、Execution Provider等关键参数的作用,便于初学者对照操作
    • 2
      针对脸部遮挡问题系统介绍三种遮罩模式及FACE MASK PADDING参数的调整思路,并给出FaceDebug调试的操作顺序
    • 3
      覆盖从单张图片到视频、再到高清特写和卡通脸的多种场景,并给出对应的推荐参数组合
  • • unique insights

    • 1
      遮罩模糊值(Mask Blur)对透明物体(如眼镜、玻璃杯)应调小以获得更真实的融合效果,与常规直觉相反
    • 2
      字幕被Box遮罩覆盖时,可通过调整FACE MASK PADDING BOTTOM并借助FaceDebug红框定位来消除遮挡问题
  • • practical applications

    • 为使用FaceFusion进行单张或视频换脸的用户提供了较完整的参数配置指南和常见问题(遮挡、字幕、高清、卡通脸)的解决思路,操作性强,可直接对照执行。
  • • key topics

    • 1
      FaceFusion Gradio界面主要参数的设置与作用
    • 2
      单张图片及视频换脸的操作流程与人脸选择模式
    • 3
      Box、occlusion、region三种遮罩模式及FACE MASK PADDING调节
  • • key insights

    • 1
      针对脸部遮挡、透明物体、字幕遮挡等具体问题给出可操作的参数调整方案
    • 2
      提供高清特写与卡通人脸替换的差异化参数组合(如codeformer替代GFPGAN、simswap_256替代InSwapper_128)
  • • learning outcomes

    • 1
      掌握FaceFusion Gradio界面中主要参数的含义与推荐设置
    • 2
      能够根据视频遮挡情况选择合适的遮罩模式并调试FACE MASK PADDING参数
    • 3
      了解高清特写与卡通人脸替换时的模型与增强算法选择思路
examples
tutorials
code samples
visuals
fundamentals
advanced content
practical tips
best practices

“ Introduction to FaceFusion

FaceFusion is a new generation AI face-swapping tool that runs with one click, requires no complicated installation, and supports occlusion removal, high-definition enhancement, and cartoon face replacement. It works across mainstream GPUs from Nvidia and AMD. The latest version adds new models and high-resolution algorithms, improving the quality of both image and video swaps, and introduces three mask modes that solve blending issues and flickering when faces are partially obstructed. This guide walks through the key parameters of the Gradio interface so you can achieve reliable face swaps.

“ Preparation and Required Resources

Before starting, you need the FaceFusion open-source project, available on GitHub. For installation steps, refer to the previous tutorial in this series. This article focuses on how each parameter in the Gradio interface affects the final result, so that you can adjust settings with confidence.

“ Core Settings for Single Face Swapping

Several settings matter most. FaceSwap must be enabled, otherwise no swap will occur. FaceDebug is only used for debugging masks and should be off for normal runs. Face Enhancer improves clarity and works well with the default GFPGAN 1.4 model. Frame Enhancer boosts overall image quality but significantly slows processing, so it is only recommended on RTX 4090-class GPUs. The default InSwapper_128 swap model works well in most scenarios. For Execution Provider, choose CPU for AMD or integrated graphics and CUDA for Nvidia cards. Thread count can be raised if you have 8GB or more of VRAM, and queue count is only needed for batch scripts. Under Options, enabling Skip-download is recommended once models are cached locally, while Keep-temp should stay off to save disk space and Skip-audio should stay off to preserve sound. To swap a single face, upload a clear front-facing photo, select the target image, click Start, and download the result. For sharper output, enable Face Enhancer and run the swap again.

“ Video Face Swapping and Key Parameters

For videos, select the source file and click the detected face to preview the result. The combination of Face Enhancer, the InSwapper_128 model, and GFPGAN 1.4 is a reliable default. Thread count can be increased based on available VRAM, and reducing it to around 12 can help if processing is slow. Enabling Keep original frame rate and Skip-download is recommended. Face selection defaults to detecting faces from left to right and replacing the first one; the Many option replaces all detected faces, while One replaces only the first. The Reference Face Distance parameter usually works at its default of 0.6. For videos with large head angles or side profiles, increasing it up to 1.5 allows more faces to be matched and swapped.

“ Using Face Masks to Handle Occlusions

When faces are partly covered by objects, choosing the right mask mode is essential. Enable FaceDebug while adjusting masks so you can preview them. The default Box mode draws a green rectangle around the face. For makeup or partial obstructions, the Occlusion mode follows the actual contours of the obstruction. Face Mask Blur, defaulting to 0.3, controls transparency of the mask; opaque objects can use values above 0.5, while transparent items like glasses often look more natural with lower values. The Region mode lets you choose specific facial parts such as eyebrows, nose, eyes, or mouth to include or exclude from replacement, which works well for talking scenes. With Occlusion or Region modes, the four padding parameters (top, right, bottom, left) fine-tune the swapped area. In Box mode, these padding values control the size of the square mask. If subtitles are blurred by the mask, adjust the bottom padding until the red box no longer covers them. Always turn off FaceDebug before running the final swap.

“ Advanced Tips for High-Definition Videos

For high-resolution footage, especially close-up shots, the Face Detector Size setting can be raised up to 1024 pixels for more accurate detection. When Face Enhancer is enabled, the CodeFormer algorithm can replace GFPGAN 1.4 in close-ups, producing more realistic skin texture.

“ Replacing Cartoon Faces

Cartoon faces require a different setup. Choose the simswap_256 model instead of InSwapper_128 and enable Face Enhancer. In this configuration, the eyes, nose, and mouth are replaced while the rest of the image remains unchanged, producing a convincing stylized result.

“ Summary

This guide has walked through the full range of FaceFusion features, from installation and single-image swaps to video processing, mask configuration, high-definition handling, and cartoon face replacement. Mastering these parameters allows you to produce consistent and high-quality AI face swaps across a wide variety of content.

 Original link: https://docs.loopin.network/zh/tutorials/faceswap/facefusion-usage

Comment(0)

user's avatar

      Related Tools