ROOP Face Swapper for A1111 - photoreal deep fake tutorial // stable diffusion

CreatixAi · Beginner ·🎨 Image & Video AI ·2y ago

Key Takeaways

The video demonstrates the use of ROOP Face Swapper for A1111, a Stable Diffusion extension, to create photoreal deep fake images with face swapping capabilities. It covers the installation and usage of the Roop extension, as well as tips and tricks for achieving optimal results.

Full Transcript

you can use AI to swap faces or at least try to using stable diffusion and an extension called Roop with it you can use just one photo to capture someone's likeness in a unique new scenario and you won't need to spend hours training Elora but if you want to I made a video about it so check it out right here it's a really insane tool and I want to show you how to install it and how to use it by the way this guide is for entertainment purposes only let's dive in first of all we need to install Roop if you prefer I also published an article on the exact same topic so you can follow along at cratexai.com and all the links are in the description SD web UI group here's the GitHub page for this project rupe is an AI software that replaces a face from any photo or video with a face of your choice SD web UI rube which is what we're looking at now is an extension for stable diffusion's automatic 1111 web UI that allows face replacement in images it's based on group but is developed separately and from my experience I think it's easy to use it's fast there's no need for lower training it doesn't require much compute power but it can be tricky to install quality can be lacking sometimes it only replaces facial features and not the face shape or proportion of the face to the body and you might need to run a lot of seeds to get a good result so here's how to install it first of all you need to have Visual Studio installed if you don't have it already you can download it for free and then during the installation check mark Python and C plus plus packages I installed python development desktop development with C plus plus and visual studio extension development if you have Visual Studio already installed but you don't have these packages you need them so just run the visual studio installer again and install them and this might take a little bit of your time time after that's done I suggest restarting your computer next up open the command window by typing CMD and run this command pip install inside page073 it's going to install and build dependencies and in a minute or so you should be done then open up your stable diffusion automatic 1111 go to extensions available load from and type in group to install it or you can also install from URL by pasting this link install and wait for the confirmation message now you have to close the command window of stable diffusion and run it again now it's a pretty simple and straightforward installation process however I ran into an error message I could install roof on the first try so I had to look up how others fix this error on reddit reddit is super helpful for that but unfortunately after 30 minutes of trying different suggestions it still wasn't working even though it has helped others so I followed my best guess and I went back to the Europe GitHub page saw an error that they mentioned and even though it wasn't mine I followed it and installed in swapper 128 model which for some reason wasn't installed together with the roof extension and I think that was the main issue but when I clicked on the link it wasn't available for download anymore so I went back to GitHub looked up and swapper and installed it from here instead then I placed this model inside the stable diffusion web UI models group directory so if you're also getting some kind of error check if you have the model placed there if not follow what I did but if you do look up suggestions on Reddit for ways to solve it and good luck I know how frustrating this can be now on to using group it can be used in text to image image to image and in painting scroll down to the script section and you should find an expandable group tap just above it here you can drop an image with the face you want to use make sure to check mark enable the restore face option you can test between code former and gfpga none produces the worst results by far as for the upscaler I suggest using one and testing which will work best in your case I often go for the 4X Ultra sharp and esrgan for x by the way for all these prompts I'm using the RPG model from City time it's version 4 and it is by far one of the most exciting models I worked with in the realm of photorealism slash fantasy it's really cool check it out alright so just pick a model write your prompt do all the settings as per usual then in the room drop an image for this one I'm using Will Smith for now I won't enable it I just want to test the seed first and I wanted to have a pirate and although this guy doesn't look like one it's okay we can work with that so now notice how when I enable stable diffusion runs and the image looks exactly the same as before and in the very last second in the very last percentage it takes a bit longer than usual to load and that's when we see the change of Will Smith's face magically appearing on this image it's pretty cool although the quality does look pretty crappy here now here is a better pirate and what you can do is use in painting as well so I just selected the face and I enabled root extension at the bottom of the end paint and as we can see it doesn't look that great it looks like I cut out the face and just stuck it on top of the original person I mean yeah that's kind of what I did but I was expecting a bit better than this either way you can see that restore phase option Nan produces the worst results and code former and gfbgan they kind of produce similar quality result it's just looks a bit different so it really depends on the image so instead what you could do is go to image to image Tab and replace a face like that and in this case I think it works out much much better because that Roop is able to identify where the face is you're not the one selecting it and then it does a better job of combining the two now is rupe some kind of superpower that will allow you to never train a Laura well I decided to test that so here's a photo of Emma Watson without using Alora without using rube just what stable diffusion and RAV animated checkpoint think she looks like looks pretty good right we can see some similarities here and there now I will use the same C the same prompt and everything just add a Laura of Emma Watson and here we have a bit different result it looks like she's a younger version of Emma Watson here but it still does look like her and then we have one with Roop and an actual photo of ammo comparing the three side by side it is kind of crazy to me how Laura and using nothing looks much better than the one with rope so not all images not all faces will work or look believable and when I tried it on a different seed I kind of had the exact same result the generation looked better without rupe and here I used in paint and created two distinct versions using two different references of Emma Watson's face and you can see the results are also very different and look like two different people in a way so there are a few things to pay attention to face shape it is extremely important for optimal likeness a different face shape means that the result will almost certainly not look like the person that you're trying to imitate you know skin tone lighting angle quality all these are important for your final image generation if one reference photo doesn't work at all try a different one and it might just work out also here's a little tip if you want to swap a person wearing glasses onto an AI generated image make sure to have glasses in the prompt as well otherwise they will not transfer and that it will just lose that extra bit of likeness oh and if you were wondering if it will solve your character problems where you want to have the same character repeated in multiple images but it is stylized then I'm sorry to say but it will just not work I tried it with the anime model and well uh yeah I think the results speak for themselves now let's look at swapping faces of multiple people you can swap faces of multiple people using the Rope extension the settings responsible for it is called comma separated face numbers for example let's say you dropped an image and you want to swap the case you leave the number at zero and now the first person on the left their face is tagged with a zero so that is the face that was replaced if for instance I say one then the next phase in the image will be replaced and now we have this very handsome man in the final generation and if we do zero comma one then both of their faces will be replaced with this one face and that's pretty crazy now what happens if you have more faces than that let's say four like in this family photo all you have to do is type in 0 1 2 3 and now we have four faces and they can all be replaced at the same time and just look at that family the resemblance and the genetic strength of this family is on the next level and that's how you replace all these faces but what if you wanted to replace multiple faces with multiple different faces from Roop you can do that so in this case you have to generate the first one then send it back to image to image now you can replace the reference change the number to 1 for example and generate it again after you're done send that image back to image to image change the reference and repeat until all the people in your generation look exactly as you want them to be there's only one thing to point out here make sure that your denoising strength and the image to image is close to zero so that faces don't change too much from one generation to next and here is another thing most results won't look the best they will slightly resemble the person you're trying to imitate but not exactly so I think the best bet is to set the batch size higher I set it to 10 with random seed enabled and most of the results won't look raid sold by running many you will have a higher chance of finding those that work out perfectly and since you're going to be running a batch size of 10 I suggest not enabling the root upscaler yet because yes it will probably produce better results but if you're batching 10 images enabling it right away is kind of a waste of time simply find the image you like and then regenerate it with your favorite seat with roof upscaler enabled but only do it when you find the perfect image that you want to do it with I also suggest enabling high-risk fix but it's honestly a suggestion that I say for all generations whether you use Roop or not another thing is that you should use a model and prompt for photorealism rup can't do stylization like cartoon anime so on so for best results have a model and a prompt for a more realistic image photorealism with a bit of painting or digital painting works as well and of course no images are perfect so you can work around that for example in this image the bandana looked weird after the roof face replacement but you just gotta go to end paint select it try a few things until it works out because it most often will and as for the case of this thumbnail that I generated I really loved it but I didn't really like the face of marks that it had so I actually changed the earring inside stable diffusion within painting and then I removed certain parts from the image inside Photoshop as well as edited some other parts made them darker blurrier and so on and I just wanted to say that you know AI is such an incredible and wonderful tool it is an assistant but at the end of the day you are the Creator and you're the one who has a vision and preferences so do act like it you know don't be afraid to edit the generations make changes and kind of put in some effort as well you know if you feel like it and this is just one of the things that I like doing on top of the generations that I love but think could be a little bit better there's always room for improvement and you know what I hope you enjoy playing around with Roop and if you're still watching thank you and maybe check out this one next see you next time cheers

Original Description

ROOP Stable Diffusion extension for A1111 is a super easy face swapper tool. Creating photoreal deep fake images with one click of a button is here. Scared yet? 🤖 Watch my Roop deepfake tutorial to learn more! 🎥 Watch Next: SDXL Lora Training tutorial - https://youtu.be/d4QJg4YPm1c How to install SDXL - https://youtu.be/cUK26AhBmZ4 \\__ Articles __// 👉 ROOP Tutorial and Installation: https://creatixai.com/roop-stable-diffusion-tutorial-installation/ 👉 Check out all blog posts: https://creatixai.com/ \\__ LINKS __// Sd-webui-Roop Github: https://github.com/s0md3v/sd-webui-roop Visual Studio: https://visualstudio.microsoft.com/downloads/ Checkmark Python development, Desktop development with C++, and Visual Studio extension development during the installation. inswapper_128.onnx model : https://github.com/haofanwang/inswapper RPG Model: https://civitai.com/models/1116?modelVersionId=7133 pip install insightface==0.7.3 \\__ TIMESTAMPS __// 00:00 - Intro 00:38 - Roop Pros and Cons 01:38 - How to Install Roop 02:50 - Roop ERROR fix 04:00 - Swap faces with Roop 06:35 - Roop VS Lora 07:36 - How to pick an image 08:55 - Face swap multiple people 10:52 - Roop tips 12:09 - Inpaint and adjust Disclaimer: This video is for education and entertainment purposes ONLY. When you use Roop, mention that it's a deepfake whenever you share it. Users of this software are expected to use this software responsibly while abiding by the local law.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

This video tutorial teaches how to use ROOP Face Swapper for A1111 to create photoreal deep fake images with face swapping capabilities. It covers the installation and usage of the Roop extension, as well as tips and tricks for achieving optimal results. By following this tutorial, viewers can learn how to create realistic face swaps and edit generated images using Photoshop.

Key Takeaways
  1. Install Visual Studio with Python and C++ packages
  2. Install Roop extension for Stable Diffusion's automatic 1111 web UI
  3. Run command `pip install inside page073`
  4. Close and reopen Stable Diffusion web UI
  5. Install Swapper 128 model
  6. Swap faces of multiple people using Roop
  7. Adjust denoising strength and image-to-image settings
  8. Increase batch size and enable random seed
  9. Enable high-risk fix and root upscaler
  10. Use a photorealism model and prompt
💡 Using multiple reference photos and adjusting denoising strength and image-to-image settings can significantly improve the quality of the generated face swap images.

Related Reads

📰
Mage-Flow: How Microsoft Built a 4B-Parameter Image Model That Competes with 32B Models
Learn how Microsoft built a 4B-parameter image model that rivals 32B models using Mage-Flow, a novel approach to image modeling
Dev.to · Prabhakar Chaudhary
📰
Teaching Kiro to Paint: A Stateful Image-Editing Skill Built on Gemini's Interactions API and MCP
Build a stateful image-editing skill using Gemini's Interactions API and MCP to generate and edit images with Kiro
Dev.to AI
📰
I Tried to Replace My Image Workflow with an AI Photo Generator. Three Times It Failed. Once It Didn't.
Learn from an experiment replacing an image workflow with an AI photo generator, and discover the challenges and one success story
Dev.to AI
📰
The Best Free AI Image Generators Better Than ChatGPT and Gemini
Discover free AI image generators that outperform ChatGPT and Gemini for specific workflows, offering superior photorealism and graphic design capabilities
Dev.to AI

Chapters (10)

Intro
0:38 Roop Pros and Cons
1:38 How to Install Roop
2:50 Roop ERROR fix
4:00 Swap faces with Roop
6:35 Roop VS Lora
7:36 How to pick an image
8:55 Face swap multiple people
10:52 Roop tips
12:09 Inpaint and adjust
Up next
Sam Altman Stealing GPUs Caught on CCTV (Sora 2 Deepfake) #shorts #soraai
Silism
Watch →