How to use Faceswap in Telegram

Prerequisite

This page is part of our ControlNet guide. It isn’t mandatory to know how to use ControlNet for this guide, but it will help if you give that a look first.

What is Face Swap?

As you can guess by the name, you can use our Telegram Bot to swap the face of one photo into countless others.  In our implementation, we store the face as a “preset”, you can assign it an easy to remember name, and then targeting other photos with it.

Limitations:

  • Your preset only works in the channel where it was used, for your privacy
  • If the input photo isn’t well lit or low quality, you will get fuzzy edges
  • It doesn’t work as well on anime
  • When the faces are already similar, the effect is more subtle. But it can be intensified or reduced using the strength parameter

Prep Tips

  • For your input photos, use high quality photos with clear lighting
  • It’s better to use a bright, daytime input photo even when you are targeting night time or indoor renders. The AI doesn’t have trouble doing style transfer, but it will struggle if it can’t clearly read the input photos
  • You can save an unlimited number of faces
  • It works best when the angle and size of the face are similar
  • Think of a naming convention to help you remember sizes and angles. For example, you can name your faces by angle and resolution like mary-forwards-1200×1200
  • Multi-angle faceswaps are not possible, use a lora instead
  • Input resolution matters. As they say, garbage in, garbage out.  For best results, work with a photo that is at or just under 1200×1200.  Above that resolution, use /facelift after it renders to get near 4k.The syntax for this is/faceswap thefaceyousaved /images:1 /size:1200×1200

Step by Step: How to Face swap

Step 1: Upload your photo to Telegram

Here we’ll use a brown eyed woman, thin pursed lips. Remember to upload the photo with compression as a file, or it will not work. If it fills your chat window, you did it correctly.

Next, save the photo as a preset by giving it a ControlNet style name.  So we’ll “reply” to the photo with the command:

/control /new:browneyedgirl

Step 2: Provide a Target photo

Just as an example, we’ll render a ginger woman. The prompt for this image is much longer, you can find it at the bottom of the page.

/render a ginger woman

Step 3:  Perform the swap

Reply to the target image with the faceswap command + your preset

/faceswap browneyedgirl

To control the effect, use the /strength parameter from 0.0 to 1.0

/faceswap /strength:1 browneyedgirl

Do it Again

/showprompt also gives you a code to perform face swaps

Troubleshooting

  • If you’re getting a “face not found” image, try doing a /facelift command on it. This will repair found faces and increase the size of the photo, two things that will help the next time you try /faceswap
  • Try cropping the edges of the image so the face is more zoomed in, so it has less pixels to work with
  • Try adjusting the brightness and sharpness of the image
  • Try a combination of these things, with another /facelift after fixing the light and clarity
  • Worst case, try a photo with a different angle

Roast yourself


And that’s it! Here’s PirateDiffusion’s developer with a pearl earring:

You can invite your friends into a Telegram group chat, program all of your faces, and roast each other:

One limitation of /faceswap is that it will target ALL of the faces, but you can use /inpaint to correct this

*The full prompt for the ginger woman in the example is:

/render /parser:new /guidance:5.5 /size:512x768 /seed:641602 (close-up editorial photo of 20 yo woman, ginger hair, slim American sweetheart), (freckles:0.8), (lips parted), realistic green eyes, POV, realistic[:, (film grain, 25mm, f/1.2, dof, bokeh, beautiful symmetrical face, perfect sparkling eyes, well defined pupils, high contrast eyes, ultra detailed skin, skin pores, vellus hair, fabric stitching, fabric texture, wood grain, stone texture, finely detailed features:1), [(lowres:1.3, blurry:1.3, worst quality:1.3), low quality, bad quality, normal quality, anime, cartoon, penis, fake, drawing, illustration, boring, 3d render, long neck, out of frame, extra fingers, mutated hands, ((monochrome)), ((poorly drawn hands)), 3DCG, cgstation, ((flat chested)), red eyes, multiple subjects, extra heads, close up, man asian, text ,watermarks, logo] <lyriel16>





Back to Tutorials