ComfyUI Reactor Workflow for Face Swap
You can easily run ComfyUI workflows in RunComfy, a cloud-based platform tailored specifically for ComfyUI. All essential nodes and models are pre-set and ready for immediate use!
Plus, you'll find plenty of other great ComfyUI Workflows on the RunComfy website.
Introduction of ComfyUI ReActor
This ComfyUI workflow excels in executing advanced face swaps across images, videos, or animations. It utilizes nodes such as "ReActorFaceSwap," incorporating models like "inswapper_128.onnx," "retinaface_resnet50," and "codeformer.pth" for accurate face detection and replacement. This functionality extends to both individual and multiple characters, offering various settings for source and target images, including model intensity and swap adjustments. It's tailored for generating realistic and flawless face swaps in multimedia content.
Features of ComfyUI ReActor
Node-Based System: At its core, ComfyUI ReActor features essential nodes:
ReActorFaceSwap (Main Node): Central to face swapping operations.
ReActorLoadFaceModel: For loading face models.
ReActorSaveFaceModel: Enables model saving for later use. These nodes interlink to perform sophisticated face swap tasks effortlessly.
Flexible Input/Output Handling:
Inputs: Accepts multiple input forms, with
input_imagefor the target andsource_imagefor the face(s) to be swapped.Outputs: Produces the swapped image and the source face's model (
face_model), suitable for any image-requiring nodes or those specific to model saving.
Enhanced Face Restoration: Built-in face restoration feature significantly improves the detail and quality of swapped faces.
Simplified Face Indexing: Offers an easy method for detecting and ordering faces within images, facilitating the swap process by indexing faces in both source and target images.
Gender-Based Swapping: Supports gender-specific face swapping for more accurate and appropriate outcomes.
Streamlined Face Model Management: Allows for efficient saving and loading of face models as "safetensors" files, improving the tool's performance and adaptability in various face swapping scenarios.
For more information, check it on ComfyUI Reactor for Face Swap Tutorial
Description
FAQ
Comments (3)
I ran this WF and it did not change the face at all. Please help.
I keep getting the error:
VFI model RIFE requires at least 2 frames to work with, only found 1. Please check the frame input using PreviewImage.What can I do? Is there a special video format needed?
Thank you!
I've just had a look at the WF OP posted, he's fucked up the noddles or whatever you call them, swap the load image nodes as source and the video as input, then image output on the first ReActor to image input on the second ReActor if you're using mutiple face (you can do it all from one image and reactor node if you know how to assign face indexes 0,1 to 3,1 etc...).
Depending on your graphics card i'd cap it at 20 frame_load_cap and select_every_nth to 4 for a preview and make sure a restore model is chosen, it's set as none by default (it can take an age so you don't want to be waiting 5 minutes for something that looks shit), if you're happy lower the select_every_nth to 2 (or 1 if you're on a 4090 or don't mind burning electricity) and frame_load_cap to zero (no cap). You might have to adjust frame rate in Video combine if it comes out at the wrong speed, this will only take a few second to correct it doesn't need to go through the whole swapping process again.
There may also be a problem with your insightface files depending on your processor, you should be able to find the correct ones on Github.
You can use most formats, I've had MP4, Webm and Gif working fine with it.

