Skip to content
Hillobar edited this page Sep 3, 2023 · 40 revisions

Overview

image

How to -

Install

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

Reuse Rope-Space Worm venv Install

Clean Install

  • Copy Github files to a local directory
  • Navigate to the Rope main directory (you will see requirements.txt, Rope.bat, Rope.py, and two 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
  • Place GFPGANv1.4.onnx, inswapper_128_fp16.onnx, occluder.ckpt, 79999_iter.pth, and epoch_16_best.ckpt in 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 dependencies:
    • pip uninstall onnxruntime onnxruntime-gpu
    • pip install onnxruntime-gpu==1.15.1
  • 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 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 to select multiple Source Faces)
  2. Type in a name, hit
  • 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
    • 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

  • Increases the resolution of the Face
  • Click to toggle on/off. 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. E.g., cup
  • 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 ). Once highlighted, name them in this text field and hit . 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

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