Skip to content
Hillobar edited this page Nov 24, 2023 · 40 revisions

Overview

image

How to -

Install

Note: It's only configured for CUDA (Nvidia)

  • Copy Github files to a local directory
  • Navigate to the Rope main directory (you will see requirements.txt, Rope.bat, Rope.py, and folders)
  • Right click and select 'Open in Terminal' (or open CMD and navigate there)
  • Set up a local venv
    • python.exe -m venv venv
  • Activate your new venv
    • .\venv\Scripts\activate
  • Install requirements
    • .\venv\Scripts\pip.exe install -r .\requirements.txt
  • Download the models and GFPGAN
  • Unzip models.zip and place the all of the model files into the models\ folder
  • Do this if you've never installed roop or Rope (or any other onnx runtimes):
    • Install FFMPEG
    • Install CUDA Toolkit 11.8
    • Install cuDNN v8.5 for CUDA 11.x from here
  • Double-click on Rope.bat!

Startup

image

  • First time use:
  1. Select your Source Faces Folder
  2. Select your Target Videos Folder
  3. Select your Output Folder
  4. Click Load Folders
  • Subsequent uses
  1. Click Load Folders. 1, 2, and 3 will be remembered from the last time Rope was used.
  • Models are now only loaded when you initialize them the first time. GFPGAN, CLIP, Occluder, and Mouth Parser are not loaded into memory until you click them. If you have lower memory, you should be able to now run more threads if you don't enable them.

Swap

image

  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

Source Face Shortcut

image

  • Create
  1. Select a Source Face (hold shift to select multiple Source Faces)
  2. Type in a name, hit enter
  • Delete
  1. Select a Source Face Shortcut
  2. Click Delete

Record/Play

image

  1. Arm/Disarm Record
  2. Play. If Record is armed, then it will record and save to the Output folder
  • Press Play again to stop Playing or Recording

Merge Source Faces

  • Select multiple Source Faces by holding down shift
    • Selecting multiple, different images of the same person can improve likeness.
    • Selecting different people will create an average of the selected faces

Interface Options

Face Options

GFPGAN / Codeformer

  • Increases the resolution of the Face
  • Left click to toggle on/off. Right Click to toggle GFPGAN or Codeformer. Scroll the mousewheel to change the strength (0% = off, 100% = full strength)

Difference

  • Allows areas of the Target Face to show where the Target Face and swapped face are similar
  • Click to toggle on/off. Scroll the mousewheel to change the threshhold (0% = very strict, 100% = no restrictions)

Top Mask

  • Lowers and Raises the mask boundary at the forehead
  • Scroll the mousewheel to lower and raise the position (0% = boundary at top, 100% = boundary in the middle of the face)

Mask Blur

  • Sets the amount of blur for the Top Mask (and consequently Side Masks)
  • Scroll the mousewheel to change the strength (0% = no blur, 100% = high blur)

CLIP

  • Create masks based on text input
  • Enter text in field separated by commas. E.g., cup,hand
  • Click on CLIP button to toggle on/off
  • Scroll the mouse wheel to adjust word strength (higher is stronger)

Occluder

  • Creates a mask of any objects that occlude the face. Good for auto masking hair. Not good for profile.
  • Click to toggle

Mouth Parser

  • Creates a mask around the mouth from the original face and the swapped face. Good for talking. Not good for preserving likeness.
  • Click to toggle

Threshhold

  • Used by the swapper to determine if the Target Face matches any faces in the frame.
  • Scroll the mousewheel to change the strength (85% default, lower is stricter, higher is less restrictive). If you are swapping two or more different Target Faces and they sometimes switch around, lower the value until they are applying correctly. Click the button to toggle applying to all faces.

Blur

  • Sets the amount of blur for all of the masks
  • Scroll the mousewheel to change the strength (0% = no blur, 100% = high blur)

Target Faces

Find

  • Finds all faces in the current frame
  • Click to find faces

Clear

  • Clears all Target Faces
  • Click to clear faces

Swap

  • Swap all Target Faces with their assigned Source Faces
  • Click to toggle Swapping on/off

Source Faces

Source Faces Folder

  • Selects the Source Face Folder
  • Click to open the file dialogue. Will automatically load the Source Faces once selected.

Source Face Shortcut Text

  • Text field to name Source Face Shortcut
  • Select Source Face (select multiple with shift). Once highlighted, name them in this text field and hit enter. The new Source Face Shortcut will be added to the Source Faces

Source Face Sortcut Delete

  • Deletes the selected Source Face Shortcut
  • Select a Source Face Shortcut. Click the button to delete.

Target Videos

Target Video Folder

  • Selects the Target Videos Folder
  • Click to open the file dialogue. Will automatically load the Target Videos once selected.

Program Options

Load Folders and Swapper

  • Loads up all the necessary data to start swapping
  • Click to load. Loads in Target Videos, Source Faces, and the Swapper model

Changelog

Fun Stuff:

  • Added mousewheel function to Mouth Parser to adjust the size of the mask
  • Added Codeformer as an enhancer option. Codeformer does a noticeably better job with skin textures, but runs slower. Right-click on the button to toggle Codeformer or GFPGAN. Note: Codeformer takes 15-30 secondfs to load the first time.

Boring Stuff:

  • Mouth Parser and Occluder now use onnxruntime instead of PyTorch. Hopefully this will solve issues with AMD cpu users
  • InsightFace libraries have been removed as a dependency
  • Dependencies have been updated and aligned
  • Performance increase
  • Swapping is now automatically toggled off when dragging the timeline slider. this is to make it more responsive. It will automatically toggle the swap back on once you stop dragging if you had swap on to begin with.

Bug Fixes:

  • Fixed bug when dragging the Video timeline. It can now be moved when playing
  • Fixed several remaining bugs with recording
  • Fixed right click behavior on the video player slider

(2023-09-03) Changes for Rope - Crystal:

  • New, slightly improved GUI
  • Merged Source Faces. Select multiple Source Faces to create an average Source Face result. Combine different people to create a blend, or select the same person from different Source Faces to improve the likeness of the person
  • Source Faces Shortcuts to always have access to your favorite faces. Works with Merged Source Faces too!
  • Improvements to layout for workflow efficiency
  • Improvements to Target/Source Face selection for workflow efficiency
  • Mousescroll on Target/Source Faces and Target Videos
  • Much lower memory requirements (only 2.7GB if you don't enable GFPGAN, CLIP, etc.)
  • Mouse scrolling in the video player cycles through the Source Faces for the selected Target Face. Quickly view your Source Faces against the Target Face!
  • More speed improvements. Results below. I'll start tracking benchmarks for each release
  • (experimental) Mouth parser. Another occlusion tool just for the mouth area. Improves dialogue and lip sync, but will replace the Source Face mouth.
  • Bug fixes

Changes for Rope - Space Worm:

  • Updated video rendering to use Target Video parameters
  • Mousewheel scroll on the time bar to control frame position
  • Added an occluder model (experimental, very fast, make sure you download the new model-link below)
  • Greatly increased performance for larger videos/multiple faces
  • CLIP crashing fixed. Add as many words as you like!
  • Detachable video preview
  • Fixed most bugs related to changing options while playing. Adjust setting on the fly!
  • GFPGAN now renders up to 512x512
  • Status bar (still adding features to this)
Clone this wiki locally