{"id":1767,"date":"2023-02-23T02:01:53","date_gmt":"2023-02-23T10:01:53","guid":{"rendered":"https:\/\/xyzcreativeworks.com\/?p=1767"},"modified":"2023-09-12T06:47:39","modified_gmt":"2023-09-12T13:47:39","slug":"face-swap-stable-diffusion","status":"publish","type":"post","link":"https:\/\/xyzcreativeworks.com\/face-swap-stable-diffusion\/","title":{"rendered":"How to face swap with Stable Diffusion (for marketing)"},"content":{"rendered":"\n

I write SEO content for a number of professional businesses and therefore I need images which reflect the diversity of their clients.<\/p>\n\n\n\n

Because some clients are in Asia, I am finding that I’d hit the perfect image on stock images, but the person in the stock image is not representative of my client’s clientele.<\/p>\n\n\n\n

In the past, I would just skip that image. These days, I can just use Stable Diffusion to do a face swap.<\/p>\n\n\n\n

I’ll show you how.<\/p>\n\n\n

Find the perfect image<\/h2>\n\n\n

Scroll through your stock image libraries and find the perfect image.<\/p>\n\n\n\n

I have some recommendations on where you can get images on this page.<\/a><\/p>\n\n\n\n

I am going to use this image which I found on Envato Elements.<\/p>\n\n\n\n

\"woman<\/figure>\n\n\n\n

I thought this image would be perfect for my dental client because the woman has a nice smile. However, since the client was based in Singapore, it would be ideal for this image to look more Asian.<\/p>\n\n\n

Crop the face out<\/h2>\n\n\n
\"Cropping
Cropping a face out in Photoshop<\/figcaption><\/figure>\n\n\n\n

I am running a Nvidia RTX2070, which works OK but it does have some compromises given that it’s a lower-end card for AI imagery purposes.<\/p>\n\n\n\n

I could just shrink the image down from 6000px on the widest end to 1000px so that Stable Diffusion would be able to inpaint it, but that would mean my final image will be 1000px forever.<\/p>\n\n\n\n

The alternative is to crop the face out, get it inpainted and then merge it back with the original image in Photoshop. This would allow me to be able to keep an image that’s as large as possible.<\/p>\n\n\n

Inpaint it<\/h2>\n\n\n

I am using the Automatic1111 GUI with Stable Diffusion so its actually very easy to do this step.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Upload the cropped image into the inpaint tab. Then, mask the areas of the face which you’d want to change.<\/p>\n\n\n

Choosing a model for realistic faces in Stable Diffusion<\/h2>\n\n\n

One of the most important aspects is choosing the right model for your face swap.<\/p>\n\n\n\n

I recommend:<\/p>\n\n\n\n