How to Use roop (face swap) with Automatic1111’s Stable Diffusion Web UI

A few days ago, I published a blog article about using roop on Windows. There is a webui extension based on the project and it works with static images. Traditionally, if you want to generate images based on someone’s face, you need to train texual inversion embeddings or Lora models, which is a very lengthy process. With this extension, all you need is an image of the person. Read on to find out how to use the extension. This is a webui extension which works with static images. If you are looking for a stand alone application which works with videos, please see this article.

Visual Studio Installation (Only needed on Windows)

  • If you use webui on a Windows machine, visit this page to download and install Visual Studio Community. During installation pick Python development and Desktop development with C++.

  • Reboot your computer

Enable the Extension

  • Click on the Extension tab and then click on Install from URL.
  • Enter https://github.com/s0md3v/sd-webui-roop in the URL box and click on Install.

  • Click on Installed and click on Apply and restart UI.
  • If this doesn’t work, try to restart webui. On one of my machines, I restarted webui several time to get this to install properly.

Example

  • After installation, the roop option is available for txt2img, img2img, and inpaint. Here is an example in inpaint.
  • Drag the original image in the inpaint image box and paint over the face.

  • Adjust the parameter as needed. I used 0.75 for the denoising strength.

  • Expand the roop section. Drag a image with a face you want to the image box. Checked Enabled.

  • Finally, click on GENERATE to swap the faces.

Source image:

Reference image:

Result image:

Note that the extension has a filter for NSFW content. So, it might fail if you use it on NSFW materials. This extension might not work with other extensions well. For example, I had to uninstall SD-CN-Animation to get it to work. There might be compatibility problem with webui versions too. I got it to work with 1.3.2 and 1.4.1, but had problems with 1.4.0.


This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.


Be the first to comment

Leave a Reply