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

ComfyUI Node: FF: Advanced Swap Face (Image)

Class Name

AdvancedSwapFaceImage

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 (Image) Description

Facilitates advanced face swapping in images with high-quality, natural results for AI artists.

FF: Advanced Swap Face (Image):

The AdvancedSwapFaceImage node is designed to facilitate advanced face swapping in images, offering a robust solution for AI artists looking to seamlessly integrate faces from one image onto another. This node is particularly beneficial for handling both single and batch image processing, making it versatile for various artistic and creative projects. By leveraging sophisticated face detection and swapping algorithms, it ensures high-quality results that maintain the natural appearance and expressions of the faces involved. The node's ability to handle multiple faces and apply different face mask types and regions allows for precise control over the swapping process, making it an essential tool for artists aiming to create realistic and compelling visual content.

FF: Advanced Swap Face (Image) Input Parameters:

source_image

The source_image parameter represents the image from which the face will be extracted and used for swapping. This image should contain a clear and well-lit face to ensure optimal results. The quality and resolution of the source image can significantly impact the final output, with higher quality images generally producing better results.

target_image

The target_image parameter is the image onto which the face from the source image will be swapped. This image can contain one or multiple faces, and the node will handle the swapping process accordingly. The target image's resolution and lighting conditions can affect the blending and realism of the swapped face.

api_token

The api_token is a security credential required to authenticate and authorize the use of the face swapping API. It ensures that only authorized users can access the service, protecting against unauthorized use.

face_swapper_model

The face_swapper_model parameter specifies the model used for the face swapping process. Different models may offer varying levels of detail and realism, allowing users to choose the one that best fits their artistic needs.

pixel_boost

The pixel_boost parameter determines the resolution at which the face swapping process is performed. Higher values can enhance the detail and clarity of the swapped face but may require more computational resources.

face_mask_blur

The face_mask_blur parameter controls the amount of blur applied to the edges of the face mask. This helps in blending the swapped face with the target image, ensuring a smooth transition and reducing visible seams.

face_occluder_model

The face_occluder_model is used to detect and handle occlusions in the target image, such as hair or glasses, that may interfere with the face swapping process. It ensures that these elements are appropriately managed to maintain realism.

face_parser_model

The face_parser_model parameter is used to analyze and segment different facial regions, allowing for more precise control over the swapping process. This can be particularly useful for complex images with multiple faces or intricate details.

face_selector_mode

The face_selector_mode determines how faces are selected for swapping when multiple faces are present in the target image. Options typically include selecting a single face or swapping all detected faces.

face_position

The face_position parameter specifies the index of the face to be swapped in the target image when multiple faces are detected. This allows users to target specific faces for swapping.

sort_order

The sort_order parameter defines the order in which faces are processed, such as from largest to smallest. This can be useful for prioritizing certain faces in images with multiple subjects.

score_threshold

The score_threshold sets the confidence level required for a face to be considered for swapping. Lower values may include more faces, while higher values ensure only the most confidently detected faces are used.

face_detector_model

The face_detector_model specifies the model used for detecting faces in the target image. Different models may offer varying levels of accuracy and speed, impacting the overall performance of the node.

face_mask_types

The face_mask_types parameter allows users to specify the types of masks applied during the swapping process, such as box, occlusion, area, or region masks. These masks help in defining the areas of the face to be swapped and blended.

mask_areas

The mask_areas parameter defines specific areas of the face to be masked during the swapping process. This allows for targeted swapping and blending, enhancing the realism of the final image.

mask_regions

The mask_regions parameter specifies particular regions of the face to be masked, providing additional control over the swapping process. This can be useful for complex images with detailed facial features.

padding

The padding parameter sets the amount of padding applied around the face mask, defined as a tuple of four integers representing the top, right, bottom, and left padding. This helps in adjusting the blending area and ensuring a seamless transition between the swapped face and the target image.

FF: Advanced Swap Face (Image) Output Parameters:

output_tensor

The output_tensor is the primary output of the node, containing the image or batch of images with the swapped faces. This tensor maintains the original format of the input images, ensuring compatibility with subsequent processing steps. The output tensor is crucial for evaluating the success of the face swapping process and can be used for further artistic manipulation or direct use in creative projects.

FF: Advanced Swap Face (Image) Usage Tips:

  • Ensure that both the source and target images are of high quality and well-lit to achieve the best results in face swapping.
  • Experiment with different face swapper models and pixel boost settings to find the optimal balance between detail and performance for your specific project.
  • Utilize the face mask types and regions to fine-tune the swapping process, especially when dealing with complex images or multiple faces.

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

No faces in face_data to swap

  • Explanation: This error occurs when no faces are detected in the target image, preventing the swapping process from proceeding.
  • Solution: Ensure that the target image contains clear and visible faces. Adjust the face detector model or score threshold to improve face detection accuracy.

Face index <face_index> out of range (only <number_of_faces> faces detected)

  • Explanation: This error indicates that the specified face index exceeds the number of detected faces in the target image.
  • Solution: Verify the number of faces detected in the target image and adjust the face position parameter accordingly to select a valid face index.

FF: Advanced Swap Face (Image) 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.