Categories: Tutorials

Reactor-Powered Face Swapping: Stable Diffusion

When it comes to Face swapping with Reactor, its one of the best ways when using Stable diffusion. Well, we want to share our experience of why to chose Reactor over Roop. As usual one day, we noticed in the GitHub community that
they had discontinued the development because their developer had posted a problematic video into their documentation.

So, we were searching for some alternatives to it which
could be in the development stages so that whenever there are some issues
regarding it, we can easily ask the community to sort out the related problems.

 After diving into the
internet and checking out multiple Github repos we found one extension called “Reactor” which is built over the
Roop with extra modification plus multiple features added into it which can generate
similar results but with better experience.

Advantages of Reactor over Roop:

-It can
generate uncensored NSFW images which is restricted on Roop.

-it gives very fast and accurate results.

-Safetensors
Face models can be saved and loaded easily.

-Easily
compatible with Automatic1111, SD.Next, Cagliostro Colab UI, ComfyUI.

-This extension is API-supported and can be used via GET/POST request.

– It can be controlled
at the log-level system.

-This is packed with extra
features like Gender detection and better scaling features.

-Its
community is working to make it better than the older ones.

-We can do multiple
face-swapping features for the source and target images with just a single
selection.

Installation process:

1. Make sure you have already installed and set up Automatic 1111 and stable diffusion models. If not then we have already explained step by step tutorial on how to install Automatic 1111 with stable diffusion on a PC.

2. Now, we have to install Visual Studio by going to their official link.

3. Click to open the Visual Studio installer to
download online and click continue to start the installation.

4. Now, a new popup message will appear. Just uncheck these features which are not required in stable diffusion face swapping (Uncheck):
-Asp.net web development
-Azure development
-.NET desktop development
And check these options:
-Python-dev.
-Desktop dev. For c++
-Visual Studio extension development
Note: If you have these extensions already on your machine then you don’t need to follow this step.

5. By pressing the window
key + R
and type cmd to open and
Run this command on your command prompt :

pip install
insightface==0.7.3 

Now, copy the GitHub repo link of the Reactor extension.

https://github.com/Gourieff/sd-webui-reactor
 

6. Open Automatic1111. Here, we need to
install the 
Reactor extension on our PC.
For that first, go
extension tab.
Then click on available and select on “
Install
from Url
” button.

Now,  paste the GitHub repo link for the Reactor extension that you copied earlier.  Just click on Install the button presented over to the left side of the dashboard. 

7. After getting installed, just Restart once again Automatic1111 to
get the effect. At the first stage of starting it will take some time to start because
it is used to download some prerequisites in the background.



8. Next, go to the txt2img tab, and you will see
a new extension has been added called 
Reactor
as you see in the above-illustrated image.

Now, if you want to learn more about face swapping using Roop and never experienced then you should also experience that as well. With this, you get a clearer understanding of face swapping.


Using Reactor extension on txt2img:

After installation of the reactor extension into Automatic1111, make sure to check the enable box to activate the Reactor extension.



Let’s say you have a source image of multiple faces. So, we will count from the left-hand side of the image starting with 0 as the index.

For illustration, we have used an image with four people. So we will count from left starting from 0,1,2,3. Similarly, for the targeted image we can use an image of multiple faces and the count starts from 0.

Now, if we want to swap faces with all the people of the source image with the targeted image then into the Comma separated face number input box of the source image we have to put 0,1,2,3 on the Comma separated face number input box of target image.

We have to put the single number 0 (if you have single face-targeted image), and if we want to use multiple targeted images (let’s say 4 faces in an image) then we have to put 0,1,2,3.


Now let’s try for gender-specific with single-face swapping. For illustration, we are using the face of Megan Fox.

Reactor provides an extra feature for gender detection which is unable in Roop extension which you can select as your requirement.


For the target image, we are using the image with a single face. This has been generated using txt2img.



Select the txt2img feature for working into this method, enable the Reactor extension, and click the Generate button.


And here is the fantastic result. You can see how the Japanese girl’s face has been swapped with the Megan fox’s face instantly.

Note: For better results, use the similar face shape and structure with the source and the target image.



Using Reactor extension on img2img:

We can use reactor extension on image to image or on inpainting mode as well.

1. Click on the “img2img” tab
presented over the left side of the Automatic1111 dashboard.


2. Now,
just drag and drop the image you want to do with face swapping. For illustration, we are using a Japanese girl image.


3. After dropping the image click the button to set the same dimension and
pixel of the image with the source and targeted image. Alternatively, you can set it with manual
settings as well.

Click on Reactor Extension
presented at the lower left corner of the Automatic1111 dashboard.



4. Now, drag and drop the image which you want to do a face swap with.



5. Press on the Enable button of the Reactor extension if not yet, and select either of the options that are Codeformer or GFPGAN. ( Here what we experienced is that Codeformer gives much better results)



6. Adjust the image height and Width. Set the Denoising strength to 0
(this is important if you are working on the face)
.

And the other image, we have chosen Megan Fox’s face image to swap with.

At last click on Generate button.


Look
at the result after swapping. The face of the Japanese girl has been replaced with Megan Fox’s face. 

So, the most important thing to note is that if you want the best results then it’s recommended to choose the same face structure while swapping the face swap.

Conclusion:

So, we have concluded that Reactor is a good alternative to Roop which
provides many extra functionalities which increase productivity in the
field of image generation.

Not only this it’s an uncensored model that gives overall control to
create an art that gives more flexibility to think beyond the limit.










admage

Share
Published by
admage

Recent Posts

Tennibot: The Tennis Ball Roomba

While some tech companies have lofty goals to transform drug discovery through AI or to…

4 hours ago

19 Captivating Selfie Ideas to Slay Your Feed

The most important problem many people face is how to take a selfie shot. Here…

12 hours ago

ComfyUI: Transform Images/Text into Lengthy Videos with Pyramid Flow

Generating longer video with maximum consistency is one of the challenging task. But now it…

4 days ago

Amazon Introduces AI-Powered Video Ad Creation Tools

Businesses that sell on Amazon will have access to new generative AI tools allowing them…

6 days ago

Enhance Image Prompts with TIPO and DanTagGen

Are you searching for the best LLM that can optimize your prompts? Here it is.…

7 days ago

18 Captivating Fashion Photography Prompts for Camera Lenses

 Here, we tested all the prompts and sharing with you. All the prompts have distinct…

1 week ago