I introduced a face-swapping plugin based on stable diffusion: roop (this plugin also has a standalone version with more features, and can even swap faces in videos).
With this plugin, you can easily swap faces with just one facial photo when using AI painting. However, the drawback of this tool is that some photos may not look very similar, so you need to generate a large number of photos to find a more suitable one.
The reason for this problem is that the model of AI painting is difficult to adapt perfectly to different angles of the face.
Recently, another face-swapping plugin based on stable diffusion has emerged. It is called FaceSwapLab, and compared to roop, it has a major advantage:
You can upload multiple photos of the same person.
This means that the face painted by AI will resemble the original material more. The model can blend the common features of these faces, resulting in a more perfect effect.
Plugin installation address:
Extended faceswap extension for StableDiffusion web-ui with multiple faceswaps, inpainting, checkpoints, ....
To install, go to Extensions - Install from URL, paste the address, and click Install. If the network is unstable, you can add a git repository-specific proxy in front:
https://ghproxy.com/https://github.com/glucauze/sd-webui-faceswaplab
After successful installation, restart the WebUI launcher, and you will see the faceswaplab menu in two locations, one in the horizontal tab:
And one in the sidebar, under ControlNet:
For normal use with stable diffusion, use the sidebar. The horizontal tab is mainly for auxiliary functions, such as comparing images and batch processing images.
Function introduction:
- FaceSwapLab tab: Provides various tools (build, compare, extract, batch process. Also, I have been busy lately, so please wait for me to have the energy to translate these menus into Chinese)
- FaceSwapLab Settings: FaceSwapLab Settings are now part of sd settings.
There are not many items that need to be changed in the settings. In terms of models, it is actually the same model used by roop.
You can choose the maximum number of facial blends (in my opinion, as long as you upload enough photos, there is no need to refine LoRA)
-
Reusing faces through checkpoints: The FaceTools tab now allows you to create checkpoints, which helps with reusing faces. When using a checkpoint, it takes priority over the reference image, and the reference source image is discarded.
-
Gender detection: The program can now detect gender based on facial detection.
-
Facial composition (blending): Multiple versions of faces can be combined to enhance the swapping effect. This blending occurs during checkpoint creation.
Used in conjunction with settings, you can upload multiple (default 3) photos for blending.
-
Preserve original images: You can choose to preserve the original image before the swapping process.
-
Multiple versions of faces for replacement: The program allows the use of multiple versions of the same face for replacement.
-
Facial similarity and filtering: You can compare faces with reference and/or source images.
-
Facial comparison: Facial comparison feature.
-
Facial extraction: Facial extraction with or without zooming.
After the configuration is complete, click Enable and upload multiple photos for blending. Wait patiently to get a photo that is much closer to the original person than roop.
Unlike roop, FaceSwapLab supports NSFW (not safe for work) mode. As for the NSFW switch, I won't say much about it. You can enable/disable it in the settings... ...