-
Notifications
You must be signed in to change notification settings - Fork 738
Home
Hillobar edited this page Nov 24, 2023
·
40 revisions
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.0.96 from here
- Double-click on Rope.bat!
- First time use:
- Select your Source Faces Folder
- Select your Target Videos Folder
- Select your Output Folder
- Click Load Folders
- Subsequent uses
- 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.
- Select a Target Video (mousewheel scroll the Target Videos)
- Move to a video frame with faces in it and click Find
- Select a found Target Faces (mousewheel scroll the Target Faces)
- 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)
- Click Swap
- Create
- Select a Source Face (hold shift to select multiple Source Faces)
- Type in a name, hit enter
- Delete
- Select a Source Face Shortcut
- Click Delete
- Arm/Disarm Record
- Play. If Record is armed, then it will record and save to the Output folder
- Press Play again to stop Playing or Recording
- 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
- 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)
- 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)
- 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)
- 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)
- 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)
- Creates a mask of any objects that occlude the face. Good for auto masking hair. Not good for profile.
- Click to toggle
- 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
- 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.
- Sets the amount of blur for all of the masks
- Scroll the mousewheel to change the strength (0% = no blur, 100% = high blur)
- Finds all faces in the current frame
- Click to find faces
- Clears all Target Faces
- Click to clear faces
- Swap all Target Faces with their assigned Source Faces
- Click to toggle Swapping on/off
- Selects the Source Face Folder
- Click to open the file dialogue. Will automatically load the Source Faces once selected.
- 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
- Deletes the selected Source Face Shortcut
- Select a Source Face Shortcut. Click the button to delete.
- Selects the Target Videos Folder
- Click to open the file dialogue. Will automatically load the Target Videos once selected.
- Loads up all the necessary data to start swapping
- Click to load. Loads in Target Videos, Source Faces, and the Swapper model
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
- 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
- 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)