ComfyUI > Nodes > Facefusion_comfyui > FF: Advanced Swap Face (Video)

ComfyUI Node: FF: Advanced Swap Face (Video)

Class Name

AdvancedSwapFaceVideo

Category
FaceFusion
Author
huygiatrng (Account age: 2009days)
Extension
Facefusion_comfyui
Latest Updated
2025-11-30
Github Stars
0.04K

How to Install Facefusion_comfyui

Install this extension via the ComfyUI Manager by searching for Facefusion_comfyui
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Facefusion_comfyui in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

FF: Advanced Swap Face (Video) Description

Facilitates precise face-swapping in videos with advanced masking, padding, and NSFW filtering.

FF: Advanced Swap Face (Video):

The AdvancedSwapFaceVideo node is designed to facilitate sophisticated face-swapping operations on video content, offering a range of advanced features for precise control over the face-swapping process. This node is particularly beneficial for AI artists and video editors who wish to seamlessly integrate face-swapping technology into their creative workflows. It allows for the selection of specific face regions and the application of various mask types, such as box, occlusion, area, and region masks, to ensure that the face swap is both accurate and visually appealing. The node also includes options for handling padding and face selection modes, providing users with the flexibility to tailor the face-swapping process to their specific needs. Additionally, the node is equipped with content filtering capabilities to detect and handle NSFW content, ensuring that the output video is appropriate for all audiences. Overall, the AdvancedSwapFaceVideo node is a powerful tool for creating high-quality, customized face-swapped videos.

FF: Advanced Swap Face (Video) Input Parameters:

source_image

The source_image parameter is the image from which the face will be extracted and swapped into the target video. This image serves as the reference for the face-swapping operation, and its quality and resolution can significantly impact the final output. There are no specific minimum or maximum values, but it is recommended to use a high-resolution image for optimal results.

api_token

The api_token is a security credential used to authenticate requests to the face-swapping API. It ensures that only authorized users can access the face-swapping functionality. If set to -1, the node will use local inference instead of the API. There are no specific minimum or maximum values, but a valid token is required for API access.

face_swapper_model

This parameter specifies the model used for the face-swapping operation. Different models may offer varying levels of accuracy and performance, so selecting the appropriate model can affect the quality of the face swap. There are no specific minimum or maximum values, but users should choose a model that best fits their needs.

pixel_boost

The pixel_boost parameter enhances the resolution of the swapped face, improving the overall visual quality of the output video. Higher values result in better resolution but may increase processing time. There are no specific minimum or maximum values, but users should balance quality and performance based on their requirements.

face_mask_blur

This parameter controls the amount of blur applied to the face mask edges, helping to blend the swapped face seamlessly into the target video. Higher values result in smoother transitions but may reduce detail. There are no specific minimum or maximum values, but users should adjust this parameter to achieve the desired level of blending.

face_occluder_model

The face_occluder_model is used to detect and handle occlusions in the target video, ensuring that the swapped face appears natural even when partially obscured. There are no specific minimum or maximum values, but selecting an appropriate model can improve the realism of the face swap.

face_parser_model

This parameter specifies the model used to parse and identify facial features in the target video, aiding in accurate face-swapping operations. There are no specific minimum or maximum values, but users should choose a model that provides the best feature detection for their needs.

face_selector_mode

The face_selector_mode determines how faces are selected for swapping, offering options such as automatic detection or manual selection. This parameter impacts the flexibility and control users have over the face-swapping process. There are no specific minimum or maximum values, but users should select a mode that aligns with their workflow.

face_position

This parameter defines the position of the face within the target video, allowing for precise placement of the swapped face. There are no specific minimum or maximum values, but accurate positioning is crucial for a natural-looking face swap.

sort_order

The sort_order parameter determines the order in which faces are processed, which can affect the final output if multiple faces are present in the video. There are no specific minimum or maximum values, but users should choose an order that prioritizes the most important faces.

score_threshold

This parameter sets the confidence threshold for face detection, filtering out low-confidence detections to improve accuracy. Higher values result in more reliable face swaps but may exclude some faces. There are no specific minimum or maximum values, but users should adjust this parameter to balance accuracy and inclusivity.

face_detector_model

The face_detector_model is used to identify faces in the target video, serving as the foundation for the face-swapping operation. There are no specific minimum or maximum values, but selecting a robust model is essential for accurate face detection.

face_mask_types

This parameter allows users to specify the types of masks applied to the face, such as box, occlusion, area, and region masks. These masks help define the areas affected by the face swap, providing control over the process. There are no specific minimum or maximum values, but users should choose mask types that best suit their needs.

face_mask_areas

The face_mask_areas parameter defines specific areas of the face to be masked, allowing for targeted face-swapping operations. There are no specific minimum or maximum values, but users should specify areas that align with their creative vision.

face_mask_regions

This parameter specifies regions of the face to be masked, offering additional control over the face-swapping process. There are no specific minimum or maximum values, but users should define regions that enhance the final output.

face_mask_padding

The face_mask_padding parameter adds padding around the face mask, ensuring that the swapped face blends smoothly into the target video. Padding is defined as a tuple of four integers representing the top, right, bottom, and left padding. The default value is (0, 0, 0, 0), but users can adjust these values to achieve the desired effect.

FF: Advanced Swap Face (Video) Output Parameters:

output_video

The output_video parameter is the final video with the face-swapping operation applied. It includes the swapped face seamlessly integrated into the target video, maintaining the original audio and frame rate. This output is crucial for users looking to create high-quality, customized face-swapped videos for various creative projects.

FF: Advanced Swap Face (Video) Usage Tips:

  • Ensure that the source_image is of high quality and resolution to achieve the best face-swapping results.
  • Experiment with different face_swapper_model and face_detector_model options to find the combination that provides the most accurate and visually appealing results for your specific video content.
  • Adjust the face_mask_blur and face_mask_padding parameters to achieve a seamless blend between the swapped face and the target video, especially in cases where the face edges are prominent.

FF: Advanced Swap Face (Video) Common Errors and Solutions:

"Cannot process video with corrupted audio. Please re-encode the video first."

  • Explanation: This error occurs when the target video has a corrupted audio codec, which prevents the node from processing it correctly.
  • Solution: Re-encode the video using a tool like ffmpeg with the command: ffmpeg -i input.mp4 -c:v copy -c:a aac -b:a 128k -ar 44100 output.mp4 to fix the audio codec issue.

"NSFW content detected in target video - returning blurred video"

  • Explanation: The node has detected NSFW content in the target video and has automatically blurred the video to ensure appropriateness.
  • Solution: Review the video content to ensure it meets your standards, or adjust the content filtering settings if necessary to allow for more lenient detection.

FF: Advanced Swap Face (Video) Related Nodes

Go back to the extension to check out more related nodes.
Facefusion_comfyui
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.