How to Face Swap in Stable Diffusion with Roop Extension
Explore a detailed guide on downloading and utilizing the Stable Diffusion Roop extension, perfect for achieving seamless face swaps with ease.
Table of Contents
1. Introduction
In the realm of digital imagery and art, the ability to manipulate faces has gained immense popularity. With advancements in artificial intelligence and image processing, tools like the Stable Diffusion Roop extension allow users to effortlessly perform face swaps, creating visually striking and realistic images. This guide will walk you through the entire process, from downloading the tool to executing flawless face swaps with ease. Whether you're an aspiring digital artist or just curious about the capabilities of modern AI, this tutorial is designed to equip you with the knowledge you need to dive into this exciting field.
2. Requirements to Face Swap with Roop
Here are the requirements to follow:
- On Windows, download and install the Community Visual Studio. During the installation process, make sure to include the Python and C++ packages.
- Open your command prompt in de stable diffusion web ui directory and run the following command: pip install insightface==0.7.3
- Open Stable Diffusion and go to the "Extensions" tab of the web UI.
- In the "Install from URL" tab, paste the following URL: https://github.com/s0md3v/sd-webui-roop
- When installed, Close the Stable Diffusion web UI.
- Download the inswapper_128.onnx model.
- Replace the downloaded inswapper_128.onnx model inside the <webui_dir>/models/roop/ directory.
- Start Stable Diffusion by double clicking the webui-user.bat file
3. Face Swapping with Roop in Stable Diffusion
Roop utilizes a two-step process for face swapping. First, the AI image is rendered completely, and then the face from the roop image is applied to the created AI image. This distinction becomes apparent during the rendering process, where the image appears finished but takes longer as the face is applied.
-
Drag an image in the Roop expansion panel
-
"Enable" Roop by checking the checkbox.
-
Click "CodeFormer" from the Restore Face options.
-
Create both a positive and negative prompt.
-
Click "Generate"
-
The ultimate outcome is the creation of a stunning face resembling Angelina Jolie, generated using your own input prompt.
4. Tips & Considerations using Roop in Stable Diffusion
To achieve the best results with Roop, there are a few considerations to keep in mind:
-
Ensure that the face in the photo is not obstructed by objects such as hair or accessorie
-
Check the Box "Restore Faces".
-
The face didn't get swapped? Did you click "Enable"? If you did and your command prompt console doesn't show any errors, it means roop detected that your image is either NSFW or wasn't able to detect a face at all.
5. Face Swap Examples (Stable Diffusion Roop Extension)
In this section, we will showcase a collection of captivating and impressive stable diffusion face swap demonstrations that highlight the remarkable capabilities of this innovative technology. Prepare to be amazed as you witness the seamless transformations made possible by the Stable Diffusion Roop Extension. Get ready for an extraordinary visual experience like no other.
Example 1 (Angelina Jolie):
- Positive Prompt: perfect hand, ultra detailed, 8k, raw photo, beautiful light, perfect shadows, (face portrait:1.5), (face portrait of a young mature women:1.3), (traditional white dress:1.2), (white dress:1.2), (silk white dress:1.3), white dress with golden jewelry, red jewelries, (cleavage:1.3), long dark hair, (green eyes:1.2), big lips, red lips, burning man desert, (wearing designer hat:1.1), (desert background:1.2), burning man festival background, shim light, tight body, dynamic angle, sexy look, natural skin, posing
- Negative Prompt: (worst quality:1.2), (low quality:1.2), (lowres:1.1), (monochrome:1.1), (greyscale), multiple views, comic, sketch, (((bad anatomy))), (((deformed))), (((disfigured))), watermark, multiple_views, mutation hands, mutation fingers, extra fingers, missing fingers, watermark,
- Sampling Steps: 50
- Sampler: DPM++ 2M Karras
- CFG scale: 7
- Size: 704x392
- Model: cyberrealistic
- Clip Skip: 2
Example 2 (Salma Hayek):
- Positive Prompt: perfect hand, ultra detailed, 8k, raw photo, beautiful light, perfect shadows, medium shot of a mature latina women, (mexican traditional yellow dress:1.2), big chest, (yellow dress:1.2), (silk yellow dress:1.3), yellow dress with golden jewelry, golden jewelries, (cleavage:1.3), burning man desert, (desert background:1.2), burning man festival background, shim light, sexy look, natural skin, posing
- Negative Prompt: (worst quality:1.2), (low quality:1.2), (lowres:1.1), (monochrome:1.1), (greyscale), multiple views, comic, sketch, (((bad anatomy))), (((deformed))), (((disfigured))), watermark, multiple_views, mutation hands, mutation fingers, extra fingers, missing fingers, watermark,
- Sampling Steps: 50
- Sampler: DPM++ 2M Karras
- CFG scale: 7
- Size: 704x392
- Model: cyberrealistic
- Clip Skip: 2
6. Alternative Face Swap Extension (ReActor Extension)
If you're interested in exploring an alternative Face Swapping Extension, be sure to take a look at our comprehensive tutorial on the ReActor Face Swapping Extension. The article outlines numerous advantages when compared to the Roop Extension and demonstrates the capabilities of this alternative.
7. Conclusion
The Stable Diffusion Roop extension offers users a unique and powerful tool for creating stunning face swaps with minimal effort. This tutorial has laid out a clear path from installation to execution, allowing you to explore the fascinating capabilities of this AI-driven technology. As you experiment and create, you'll find various applications for your newfound skills, whether for personal projects or professional endeavors. Embrace this opportunity to enhance your digital artistry and dive into the world of AI-driven image manipulation.