Guide Fake Video Face Swap (moderate complexity, Rope)

  • Welcome to the Fakes / AI / Deepfakes category
    When posting AI generated content please include prompts used where possible.

softarchitect

Tier 3 Sub
May 16, 2022
55
420
512
0fya082315al84db03fa9bf467e3.png

DISCLAIMER: This guide is somewhat technical, there are probably cases / errors that are not included in this guide, and can cause you to waste time and effort without any success.​


0. Introduction​

This guide will provide steps to install Rope (
Please, Log in or Register to see links and images
) to create videos by face swapping a person's face onto another video.

1. Requirements​

This application works with both CPU and GPU setups.

When using Windows, this guide requires Windows 10 1709 (build 16299) or later (incl. Windows 11).

While a Nvidia graphics card (GPU) is not required, it will make the swapping process much faster.
If you have a GPU, install Nvidia's
Please, Log in or Register to see links and images
and
Please, Log in or Register to see links and images
if you have not already installed these.


2. Installation​


Please, Log in or Register to view spoilers

Please, Log in or Register to view spoilers

Please, Log in or Register to view spoilers

3. Preparation​

3.1. Source (Celeb/Influencer)​

First you have to decide with person you want to swap in to a video.

Select some high quality pictures where the face is visible, and where the part of the face is not too small. E.g. full face image (+- 300-400px image height), half body image (+- 750 - 1024px image height), full body image (1024+px image height, best to avoid these). The higher quality / size, the better.

It's also best to select several pictures where the person is looking to the left, front and right. The model will "merge" the different faces to get optimal results. Even selecting pictures with the teeth visible, closed eyes, etc can improve the result a little bit.


3.1. Destination (Porn star)​

This is the hardest part, finding a porn star that has a face that has the same "dimensions" / shape as the chosen person in the previous section.

Using "Face Match" tools will not (always) work, since these will most of the time look at the face itself, and not the shape. YMMV



3.2. Target Video​

Note: this method will give bad results if the video has frames with obstructions in front of the face.

When selecting a video, it's best to cut/slice the video and remove unwanted / filler scenes, scenes with obstructions in front of the face, etc.

There's a lot of software that can slice / edit videos, some free/opensource options:
Please, Log in or Register to see links and images
,
Please, Log in or Register to see links and images
,
Please, Log in or Register to see links and images

This guide will not include how to edit videos with the above software, there are enough guides on that elsewhere.

It's also a good idea when editing the video, to transcode to 720p and 24 frames / second, this is improve the speed of the process and not waste resources. But that's up to you :WeSmart:


4. UI​

265270793-fda0c05f-72a6-4935-a882-dc6d17cfc014.png


The UI has 3 "input" sections. From bottom to top:
  • Video selection
  • Source Faces
  • Destination Face

5. Start​

To start the process:
  • Select your Source Faces Folder
  • Select your Target Videos Folder
  • Select your Output Folder
  • Click Load Folders
  • Click on GFPGAN (used to improve / upscale the resulting face)
  • All other settings are optional and can either improve or degrade the result. E.g. you can use CLIP with "hands, penis" in the input box or Occluder/Mouth Parser to improve the result when there are obstructions in front of the face. But it will never be 100%, there will be a lot of distortion, etc. Best solution is to avoid frames with obstructions.
265268484-adbd042f-0a7b-4d3a-9f36-674d502965c3.png

  • 1. Select a Target Video (mousewheel scroll the Target Videos)
  • 2. Move to a video frame with faces in it and click Find
  • 3. Select a found Target Faces (mousewheel scroll the Target Faces)
  • 4. Select a Source Face (hold shift to select multiple Source Faces), (mousewheel scroll the Source Faces), (mousewheel scroll in the Video Player to iterate through the Source Faces)
  • 5. Click Swap to test the swap
  • 6. Move to the first frame in the video, click on the circle (Record) and then press the Play icon.

6. Additional Tips​

  • When asking for help, don't forget to add a screenshots of the console output if there are any errors
  • Whenever you see 'OOM (Out of Memory)' in the console output, it most of the time means that you do not have enough system RAM or (graphics) VRAM to run it
  • The mousewheel does not seem to work on Linux
 
Last edited:

softarchitect

Tier 3 Sub
May 16, 2022
55
420
512
0fya082315al84db03fa9bf467e3.png
Please, Log in or Register to view quotes
AFAIK, no, this requires a UI, and Colab doesn't do UIs.

You can try Refacer (
Please, Log in or Register to see links and images
), but I have not tested this, and not sure if it has NSFW checks.

But let me know if it works, so I can add it to the post.

Also, be aware that doing NSFW on Colab can get you banned.
 

thebadbone

Tier 2 Sub
Mar 17, 2022
19
197
384
0fya082315al84db03fa9bf467e3.png
Managed to get into the UI but when trying to add the Source folder it doesn't work. The console says: "onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from .\models\det_10g.onnx failed:Load model .\models\det_10g.onnx failed. File doesn't exist" and indeed, there is no det_10g.onnx file within the models folder as it's missing from the models archive provided. Any suggestions?
 
Last edited:

softarchitect

Tier 3 Sub
May 16, 2022
55
420
512
0fya082315al84db03fa9bf467e3.png
Please, Log in or Register to view quotes
Yeah, CLIP and Mouthparser are better than nothing, but it's highly dependent on the scene, etc. and most of the time not that good.

Where "real" deepfaking (DeepFaceLab, etc) takes days, weeks or months to master to get good results, Rope, and similar faceswap tools, are the lazy-mans deepfake tool :KEKW:

It's a pity the original creators of the inswapper model (InsightFace) have fully closed it off from the public. The current inswapper model, used by all the latest faceswap tools, is a 128x128 resolution model. Meaning it will result in a maximum face size / resolution of 128 by 128 pixels, that's why you have to use upscaling (like GFPGAN) to get "good" results. Else the face will just be pixelated / blurry.
 
  • Like
Reactions: Axelhart69

Axelhart69

Casual
Feb 26, 2023
19
28
329
0fya082315al84db03fa9bf467e3.png
Please, Log in or Register to view quotes
Just download models from the official gjthub:
Please, Log in or Register to see links and images

Read into the different options and experiment with them for bj videos.
Please, Log in or Register to see links and images

There is no good option for BJ videos.

The only way is to unmask the area of the mouth, so it don't get swapped in that area. Downside: original mouth, visible edge between orig and swapped face, due to movement, areas which need to be masked/unmasked are likely changing and orig/swapped aras will clip e.g. Sometimes you will see orig mouth ans swapped mouth. Sorry, not sure how to explain it better.
 
  • Like
Reactions: coins

thebadbone

Tier 2 Sub
Mar 17, 2022
19
197
384
0fya082315al84db03fa9bf467e3.png
Any idea how I can improve performance? I had to install OS from scratch and ROPE is very slow now while it used to be at a decent speed prior to OS install. Running a RTX3070 + 32 GB + R7 5700x on W10 X64.
 
  • Like
Reactions: jj1888

leersfan34

Lurker
Mar 14, 2022
1
1
58
0fya082315al84db03fa9bf467e3.png
Please, Log in or Register to see links and images


I see at the start of the thread it says you do not need a Nvidia GPU. But this prompts me after I double-click the rope.bat file asking me for a Nvidia GPU. Is there another way I am missing as to how to do it with AMD GPU's? Or is it simply strictly Nvidia as of right now?
 
  • Like
Reactions: alejandro0104

coins

Casual
Dec 3, 2022
4
32
325
0fya082315al84db03fa9bf467e3.png
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from .\models\det_10g.onnx failed:Load model .\models\det_10g.onnx failed. File doesn't exist

I can't find source faces

I'm using Windows 10
 
  • Like
Reactions: mattakin2020

Axelhart69

Casual
Feb 26, 2023
19
28
329
0fya082315al84db03fa9bf467e3.png
Rope is my new favourite tool since a few weeks. With the additional options you can even get some okeyish results with obstructions in front of the face