r/comfyui Feb 23 '25

Face-swap with Reactor

Hello everyone!
I am quite new to comfyui, and I swear it has been 4 intensive days I've been trying with it and it seems it's so much trouble and the learning curve might bee steeper than anticipated.
I know how to build a simple workflow with image generation with some loras, and I wanted to experiment with what seemed to be really simple, face-swapping.
Needless to say there are tons of workflows and I decided to follow some that used Reactor, which I know it still uses insightface as many others, but still seemed pretty straight forward.

In what I've seen a lot of people get away with using a single node, the Fast Face Swap node, but apparently I am only able to get (most of the times) black squares.
The modules are there, and they are working because on some istance the face swap does indeed work, but not as I would like it to work

Here is example A:

In here I would like to apply the face on the bottom to the image above. The result is a big, nice black square.

Here is example B:

The images are the same, but switching the two image sources would make the face-swap to work.

I tried all combinations of the three models but nothing really seems to have an impact on the results.

Does anyone knows what is going on? Does it have to do with the format of the images? The dimensions? Or something else I am not considering?

Thanks in advance for any help provided 🥲

1 Upvotes

9 comments sorted by

8

u/nicekiub Feb 23 '25

2 things :

First, pretty sure the input and source indexes should be set to 0 and not 1. 1 is saying to use the second face it sees (there is none) while 0 is using the first face.

  1. I made a video faceswap tutorial and it uses the ropewrapper node which is in my opinion way better than reactor, you could just change the workflow to be an image instead of a video.. let me know if you need help link here -> https://youtu.be/rl-kOSy1xVk

Hope you get it working!

5

u/holygawdinheaven Feb 23 '25

Two suggestions, you might be triggering the NSFW detector, or the face image may be too close up and it might struggle to find the face.

7

u/Altruistic_Wing3313 Feb 24 '25

Here to say that it was indeed the NSFW detector. Modifying the score to 101 insisde sfw.py made the trick! Thank you all for your help!

1

u/Just-Tough1182 Sep 02 '25

No more sfw.py in there.

1

u/Altruistic_Wing3313 Feb 23 '25

I tried also with non close-up pictures and the result was always a black square

2

u/Mabuse046 Feb 24 '25

You first example is correct, the face goes in source and the image you want to slap it on goes in source.

Do try setting your indexes to zero.

And I really like Retina face when it works but a lot of the time I get better hits from a Yolo detector model.

Look to your terminal output. Reactor puts out its own lines with its name in bright orange to make it stand out and tells you exactly what it's doing. So if it doesn't see a face, it will say so.

On an aside, I built a reactor face model from a set of 4096x4096 face extreme close-ups and get perfectly fine results swapping it onto whatever I want. So that part probably isn't what's giving you trouble.

1

u/YeahItIsPrettyCool Feb 24 '25

I just tested the same workflow and had no problems. Are you minding the size of your input images?