Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates precise face-swapping in videos with advanced masking, padding, and NSFW filtering.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
source_image is of high quality and resolution to achieve the best face-swapping results.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.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.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.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.