Awesome
!!! This project is no longer being maintained !!!
I recommend trying these extensions instead https://github.com/Bing-su/adetailer and/or https://github.com/Gourieff/sd-webui-reactor
Batch Face Swap extension for https://github.com/AUTOMATIC1111/stable-diffusion-webui
Automaticaly detects faces and replaces them.
Installation
Automatic:
- In the WebUI go to
Extensions
. - Open
Available
tab and clickLoad from:
button. - Find
Batch Face Swap
and clickInstall
. - Apply and restart UI
Manual:
- Use
git clone https://github.com/kex0/batch-face-swap.git
from your SD web UI/extensions
folder. - Open
requirements_versions.txt
in the main SD web UI folder and addmediapipe
. - Start or reload SD web UI.
txt2img Guide
- Expand the
Batch Face Swap
tab in the lower left corner. <details> <summary>Image</summary> <img src="https://user-images.githubusercontent.com/46696708/236360445-7391d68b-4973-4b43-aa75-f8a8782f6c4e.png"> </details> - Click the checkbox to enable it. <details> <summary>Image</summary> <img src="https://user-images.githubusercontent.com/46696708/236361252-5a1d05c8-e216-4685-a7ef-80733e08a08a.png"> </details>
- Click
Generate
img2img Guide
- Expand the
Batch Face Swap
tab in the lower left corner. <details> <summary>Image</summary> <img src="https://user-images.githubusercontent.com/46696708/236361645-84519cfe-d6a1-492f-adab-3baca037b6de.png"> </details> - Click the checkbox to enable it. <details> <summary>Image</summary> <img src="https://user-images.githubusercontent.com/46696708/236361252-5a1d05c8-e216-4685-a7ef-80733e08a08a.png"> </details>
- You can process either 1 image at a time by uploading your image at the top of the page. <details> <summary>Image</summary> <img src="https://user-images.githubusercontent.com/46696708/236361988-78cfe787-d17a-46a1-bb41-4865a57dcdda.png"> </details> Or you can give it path to a folder containing your images. <details> <summary>Image</summary> <img src="https://user-images.githubusercontent.com/46696708/236362301-53ce2315-9fa1-46e3-9698-d9164e1354be.png"> </details>
- Click
Generate
Override options only affect face generation so for example in txt2img
you can generate the initial image with one prompt and face swap with another. Or generate the initial image with one model and faceswap with another.
Left 'young woman in red dress' using chilloutMix
Right 'Emma Watson in red dress' using realisticVision
<img src="https://user-images.githubusercontent.com/46696708/236363435-07e1cc38-062b-4696-9ce3-11239812f898.png">
Example
Prompt:
detailed closeup photo of Emma Watson, 35mm, dslr
Negative prompt: (painting:1.3), (concept art:1.2), artstation, sketch, illustration, drawing, blender, octane, 3d, render, blur, smooth, low-res, grain, cartoon, watermark, text, out of focus