(Originally posted on seelemons.com on Aug 18, 2023)
Random Observation/Comment #814: Faceswapping is my new party trick. Don’t trust anything on the internet.
In this Guide
I spent a week having way too much fun creating faceswaps using InsightFace and MidJourney discord bots. The bot does all of the work including color/lighting, matching facial expressions, keeping scars/patterns, and addition/removal of glasses. What would take a photoshop expert a few hours is really just 30 seconds. Here are some results and videos from my YouTube and Instagram:
In this guide, I’ll share my process from installation to video creation. I’ve gotten good enough to take a photo of a friend and get a swap result within 5 minutes. It’s a great party trick.
Note: The Insightfaceswap app might need a subscription payment now. I supported them on patreon a few months ago so I think my discord bot still works on an older plan.
Installation
Start your own discord server – Instructions from Discord support
Login to your Discord app from mobile or desktop
Click the “+” button on the left hand column of the Discord page – Choose “Create a server” option
Add server info by naming your Server Name and clicking “Create”
Install the Midjourney bot to your discord – MidJourney instructionss for inviting the bot to your server
Go to the Midjourney discord server: https://discord.gg/midjourney
On the right side of the Member list, you should be able to see the Midjourney Bot
Select the server you want to add it to and follow the directions on discord to Authorize the bot
Now in your discord, you should be able to start your “/imagine” and other commands
Install the InsightFace bot to your discord – https://discord.com/oauth2/authorize?client_id=1090660574196674713&permissions=274877945856&scope=bot
Select server to add to and click “Continue”
And that’s it! One step magic. Your discord bot should now be able to activate commands with “/saveid” and “/setid”
Setup InsightFace on your photo
Type “/saveid” and select the command
The “idname” is how you will reference the image and change as needed
Upload the image. If this is your first photo, the ID will be set as default. Note that your photo can have glasses and should be a forward facing with even lighting and no smile. The above one is the one I’ve used and it was able to remove my glasses for most photos.
Add a photo to the server by clicking the “+” button and finding an image you want to face swap. You can also just do a Midjourney generation. For instructions on midjourney, you can follow the quick start guide
Swap!
To run the swap, right click (or long press on mobile) the image you want to faceswap with and go to “Apps” >> “INSwapper”
And Voila! You did it! Once this is all setup, you can do it directly from your mobile app.
Adding more IDs
If you want to add another photo then use “/saveid” again with the known “idname”. To switch the photo, then you can use “/setid” with the new idname. If you forget the photos you’ve uploaded, you can use the “/listid” command to list all saved IDNAMES.
Quick Tip: I’m able to generate some pretty good faceswapping images by using MidJourney prompt with “30 year old asian man with strong jawline and glasses, in style of …” This would create an Asian superman and match my skin tone.
This also all works with existing images, so I did some swaps of famous paintings:
Here’s some that are more recent using MidJourney consistent characters with Faceswapping:
~See Lemons Face Swap