How to Face Swap in Stable Diffusion with ReActor

Hello everyone~!
With so many fun and diverse AI platforms and services emerging, today I’d like to introduce ReActor, an extension for Stable Diffusion that allows for quick face swap, similar to Deepfake. Doesn’t it sound like a fun tool to use?

ReActor (Face Swap)

ReActor is an extension for Stable Diffusion WebUI that facilitates easy and accurate face replacement (face swap) in images.

It’s a straightforward tool that swaps faces, and we’re going to try it out right now.

How to Face Swap in Stable Diffusion with ReActor Banner

1. Preparations

  • WebUI Stable Diffusion / Automatic1111
  • ReActor Extension
  • Your chosen base model
  • A face photo of the person you want to test

Isn’t today’s preparation list quite simple? You might already have WebUI Stable Diffusion installed, but if it’s your first time, I recommend checking it out using the link below.

–> [Install WebUI Stable Diffusion]

Now that everything’s ready, let’s start with how to install the most important ReActor extension.

2. How to Install ReActor

ReActor can be installed by copying the code from GitHub, similar to other extensions we’ve shared.

Copy the URL from the link below and paste it into the Extensions tab in WebUI Stable Diffusion to install it.

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

After installation, refresh Stable Diffusion by clicking ‘Apply and restart UI’. It’s pretty simple, right?
You’ll now see the UI at the bottom left of the main Txt2Img page, as shown in the picture.

image 65
ReActor Extension

If you don’t see this UI, follow the next step.

For Windows 10, 11 Version: Go to https://visualstudio.microsoft.com/ko/visual-cpp-build-tools/ and download and install Visual Studio’s Build Tools.
Choose the C++ option and the Windows 11 SDK from the list on the right.

Once installed, go into the stable-diffusion-webui folder, run the Terminal, type “venv/script/activate” and press enter.
Then type “pip install insightface==0.7.3” and press enter to start another installation.

If you followed all the steps, you should now see the ReActor extension tab on your screen.

3. Creating the Desired Model

If you’ve previously worked with virtual image projects using Stable Diffusion, this will be an easy and enjoyable step.

Choose the base model you prepared and create your desired output. I’ll add a few conditions to use ReActor clearly. I’ve written the prompts this way to get the right effect with ReActor. If you don’t want to write anew, just follow my lead!

Settings

  • Base Model: dreamshaper_8.safetensors
  • VAE: Automatic
  • Positive Prompt: (high resolution), (high quality), (highly detailed), 1girl, orange short hair, white t-shirts, blue jeans, upper body, looking at viewer, simple background
  • Negative Prompt: Easynegative, (worst quality), watermark
  • Sampling Method: Euler a
  • Sampling Steps: 20
  • Size: 512×512
  • CFG: 7
  • Seed: 2979862768
image 68
Settings for Mdoel

Following my settings and generating the image, you should get a similar outcome as shown. It’s an image of a woman with orange hair in a white tee, looking at the camera. Keep the Seed value as it is, and let’s now use the ReActor extension.

4. Creating Images with ReActor

When you unfold the ReActor tab at the bottom left, you will see a space under the Main tab to drag images and some settings. We’ll drag and drop the face image into ReActor, just like we did in ControlNet.

image 71
Adding Image in ReActor Tab

ReActor extension is specialized in “faces” so you’ll see options like Female Only or Male Only. Since we’re changing a woman’s face, activate all the Female Only buttons, check the Enable button, and then press generate again to create the image.

2 9
ReActor Generated Image

Wow!!! Can you see the woman with orange hair but a distinctly different face? This seems like a truly incredible technology. The fact that simply uploading an image can change a face so naturally… it’s genuinely moving.

5. Additional Settings

If you’re a first-time user or just looking for simplicity, the settings I just showed you are enough to yield impressive results. However, those other setting tabs next to the Main one are making me too curious not to try them out myself. Haha.

Upscale

The tab right next to it, Upscale, is a feature many of us are familiar with. It allows you to adjust the scale of the face image that will be used for replacement in ReActor. The options are the same as the upscalers found in the basic Stable Diffusion’s Hires.fix, so you can apply the scale you want for a clearer and larger image.

Settings

The last tab, Setting, is directly related to your hardware, i.e., your computer. The options are mainly divided into CPU and CUDA, which ask which hardware you want to use for the extension’s computations. Simply put, most 2D, 3D, and video data, like movies, dramas, and posters, are created through a process called rendering, which you can think of as computation. I recommend those using GPUs to choose CUDA for overwhelming performance when generating images.

Be aware, if you choose CPU… even moving the mouse might become a burden, so please~! keep that in mind!

Today, we explored the face-swapping technology similar to deepfake, ReActor. It’s really easy and simple to use, making it accessible for anyone! That’s its biggest advantage. Next time, I’ll explain another innovative technique, so please stay tuned!

3 thoughts on “How to Face Swap in Stable Diffusion with ReActor”

  1. An intriguing discussion is definitely worth comment. I believe that
    you ought to write more on this subject matter, it might not be a
    taboo subject but usually people do not talk about such issues.
    To the next! Many thanks!!

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart