Video Face Swaps: Roop & NextView Extension (Stable Diffusion)

Updated
Video Face Swaps: Roop & NextView Extension (Stable Diffusion)
Effortlessly create deepfake videos with Roop and NextView Extension, harnessing the power of Stable Diffusion for easy video face swaps.

1. Introduction

Are you interested in effortlessly creating deepfake video face swaps using stable diffusion technology? You've come to the right place! Our tutorial guides you through the straightforward process of achieving this with ease.

This guide will assist you in navigating and installing the necessary extensions for achieving stunning video face swaps. Don't hesitate any longer, let's get started right away!

2. Requirements: Video Face Swapping

Prior to diving into the creation of remarkable video face swaps, it's essential to have specific extensions installed. The following extensions are required:

Requirement 1: Roop Extension

If you haven't installed the Roop extension yet, there's no need to worry. We've provided a detailed guide below on how to install and utilize the Roop extension:

How to Face Swap in Stable Diffusion with Roop Extension

Requirement 2: NextView Extension

If you want to efficiently transform an original video into an image sequence and subsequently convert the face-swapped images back into a video, all without exiting the stable diffusion interface, the NextView extension is your ideal choice. More information can be found on the NextView Github Page.

  • Open your Stable Diffusion Web UI.
  • Click on the "Extensions" tab.
  • Navigate to the "Install from URL" subsection.
  • Paste the following URL: https://github.com/NextDiffusion/next-view
  • Click on the "Install" button.
  • After installation go to the "Installed" tab and click on "Apply and restart UI".

Note: Ensure that ffmpeg is installed on your system. Uncertain about the installation process for ffmpeg on your device? We suggest referring to this tutorial for guidance on ffmpeg installation.

Requirement 3: Initial Video

Make sure you possess an initial video to initiate the face swap process. In this tutorial, we'll be utilizing the video provided below for our demonstration, this video is downloadable, allowing you to access it and follow the tutorial step by step.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds
20% bonus on first deposit

3. Stable Diffusion Settings

Before we proceed, it's crucial to ensure that specific global settings are correctly configured. These global stable diffusion settings play a vital role in guaranteeing the accuracy of the names for the face-swapped image sequence. This precision is essential for the seamless utilization of the image sequence in the NextView Extension. Furthermore, it's imperative to have the image sequence in PNG format for optimal results. These measures are pivotal in the creation of a stunning video.

  • Navigate within Stable Diffusion to the "Settings" tab.
  • Click on "Saving images/grid" in the left sidebar.
  • Confirm that the "File format for images" is set to png.
  • Ensure the "Images filename pattern" field is left empty.
  • Make sure the option for "Adding a number to the filename when saving" is unchecked.

video-face-swaps-roop-nextview-extension-stable-diffusion-global-stable-diffusion-saving-image-settings.webp

After configuring the settings correctly, select "Apply settings," followed by clicking on "Reload UI."

4. Video to Image Sequence (NextView Extension)

Once all the specified requirements are successfully installed, the procedure will commence by accessing the NextView Extension.

  • Navigate to the NextView Extension within Stable Diffusion.
  • Place the video onto the canvas within the NextView Extension.
  • Click on the "Generate Image Sequence" button.

video-face-swaps-roop-nextview-extension-stable-diffusion-nextview-extension-video-2-image-sequence.webp

After the process is complete, you will be given a file location containing all the generated images extracted from the video. You can now proceed to copy this file location, which will enable you to utilize the image sequence for batch processing within the Img2Img tab.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds

5. Img2img Settings (Batch)

After copying the file location containing the image sequence extracted from the video file using the NextView Extension, you can move on to the Img2Img "batch" tab.

Img2img batch settings

  • Copy the file location containing the image sequence extracted from the video file using the NextView Extension.
  • Navigate to the Img2Img tab.
  • In the Img2Img "batch" subtab, paste the file location into the "input directory" field.
  • Choose a suitable location for the "output directory." (This is where all the batch face-swapped images will be stored)

video-face-swaps-roop-nextview-extension-stable-diffusion-img2img-settings-batch.webp

Note: The location you entered in the "output directory" will be used later to convert the images into a video with the NextView Extension.

Global Img2Img settings:

  • Checkpoint: Realistic Vision
  • Sampling Method: Euler a
  • Sampling Steps: 30
  • Denoising Strength: 0 (We've set denoising to 0 because our intention is to preserve the image sequence as is, without altering anything except for the face)
  • Seed: -1
  • Width & Height: Make sure that the video ratio aligns with the image sequence you supplied earlier, in our case, this ratio is 9:16.

video-face-swaps-roop-nextview-extension-stable-diffusion-img2img-settings-batch.webp

Now that we have these settings in place, we can transition to the following stage, which entails employing the Roop extension for face swapping. Hopefully, you already have a fantastic face in mind for the face swap! Let's move forward.

6. Roop Extension Settings (Face Swap)

If you've been following this tutorial, you'll find a dropdown menu featuring the Roop extension. Open this dropdown and upload an image of the beautiful face you'd like to apply to the image sequence. For the sake of this tutorial, we've selected the stunning image of Salma Hayek as our choice. And, of course, remember to "Enable" the Roop extension as shown below:

video-face-swaps-roop-nextview-extension-stable-diffusion-roop-extension-salma-hayek-face-portrait-beauty.webp

Now, click the "Generate" button and patiently await as your image sequence goes through the face-swapping process using the face image you've provided on the Roop extension canvas.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds

7. Image Sequence to Video (NextView Extension)

Once everything has finished rendering, proceed by copying the output directory file location where the face-swapped images are stored.

video-face-swaps-roop-nextview-extension-stable-diffusion-output-directory-face-swapped-images.webp

  • Copy the output directory location.
  • Access the "NextView" extension in the top navbar within Stable Diffusion.
  • In the NextView Extension, go to the "Image Sequence 2 Video" tab.
  • Paste the file location into the "Image Sequence Location" text field.
  • Click "Generate Video" to convert the face-swapped image sequence into a video.

image7.png

Note: The output location of the video will be the following: "stable-diffusion-webui>extensions>next-view>output_videos"

8. Example: Face Swapped Video (Salma Hayek)

If you've followed this tutorial accurately, you should have successfully created a face-swapped video featuring the beauty of Salma Hayek, as shown below.

Stable Diffusion in the Cloud⚡️Run Automatic1111 in your browser in under 90 seconds

9. Conclusion

After following this tutorial, you should now have created an impressive face-swapped video, as illustrated in our example showcasing the beauty of Salma Hayek. We trust that this guide has provided you with valuable insights and assistance in your exploration of the potential of deepfake technology. Embrace your creative ventures and enjoy the journey!

Frequently Asked Questions

To create video face swaps, you'll need to ensure you have the following requirements in place:

  • Roop Extension: This extension enables face swapping in Stable Diffusion. If you haven't installed it yet, you can find installation instructions in the guide provided.

  • NextView Extension: This extension allows you to convert an original video into an image sequence and later transform the face-swapped images into a video. Installation instructions for NextView are available in the tutorial.

  • Initial Video: You should have an initial video that you wish to use for the face swap process. In the tutorial, a downloadable video is provided for demonstration purposes.

After the face-swapping process is complete:

  • Copy the output directory file location with the face-swapped images.
  • Go to the NextView extension in the top navbar of Stable Diffusion.
  • In the "Image Sequence 2 Video" tab of the NextView Extension, paste the file location into the Image Sequence Location field.
  • Click "Generate Video" to create the video from the face-swapped image sequence.
character creation tool card

AI Image Generation Tool

Create Your AI Images in Seconds!

News & Updates