LivePortrait: Ultimate Install Tutorial for Windows Web UI

Introduction
Once in a while, an AI Tool pops up, that delivers BEYOND expectations.
The newly released LivePortrait Face Animator, is one of those tools.
It ticks all the boxes – simple to use, open-source, completely free, no limitations, local install, and produces truly incredible results in terms of quality.
LivePortrait has three key features, with a huge fourth one coming shortly.
First, “image + video, to video”. You upload a photo that you want to animate, and upload a video, called the driving video, that has the facial animations that you want transferred onto your photo. Then you just hit the “Animate” button. The processing time is surprisingly quick. Out pops the video of your photo, with the facial animations and movements from your driving video. That’s it. Simple.
Second, is the “generalisation for animals”. This is actually pretty cool. They’ve done a lot of fine-tuning on animal data. Upload an image of an animal, or even your pet dog, and a video of you making all sorts of facial expressions. Then out pops a bizarrely realistic video, of your pet dog making your facial expressions. Incredible, although a little bit strange!
Third, “eyes and lips retargeting”. These are the fine-tune settings that you can apply to your final video. You can control the EXTENT that the eyes and lips open. This gives you the ability to control the EXACT extent of expressions that you’re looking for.
The fourth huge update, is “video + video, to video”. This hasn’t been released yet, but is due any time now. This will be a huge update, and open up all sorts of new creative possibilities. Instead of uploading a source IMAGE of the character you want to animate, you’ll have the option to upload a video instead. Then you upload the usual additional face expression driving video, and out pops the source video with your facial expressions. The examples released so far, really are outstanding in terms of quality, accuracy and realism.
The surprising thing about LivePortrait, is not only the range of facial expressions and head movements, that it does so well, but the incredibly high, natural and realistic quality of the resulting video animation.
There’s a few other face animation AI Tools, but these mainly focus on talking photos. You upload a photo and some text or audio, and out pops your animated talking photo. They’re actually pretty cool. However, the BIG drawback is, you don’t have control over HOW the face is animated. The tools themselves determine the facial animation, including expressions and movements, according to the text or audio uploaded.
LivePortrait puts complete facial animation in the control of the creator. Adding in audio on top is the easy part, but getting EXACTLY the facial expressions and movements that you want, that actually look realistic, now that’s the real hard part.
The creative possibilities really are becoming endless.
Mixing LivePortrait with an image generator and audio tool, allows you to create much more realistic talking avatars.
Or create entire AI generated movies, with EXACT character face expressions and movements that LOOK realistic, is now easier and better with LivePortrait.
Anyway, the best way to really experience LivePortrait is to actually try it yourself.
By far the best way to use it, is to install it on your local machine.
So, in this video, I’ll be walking through the complete, recommended, step-by-step installation for LivePortrait, on a Windows 11 PC.
So, let’s crack on.
Getting Ready for LivePortrait Installation
Before we begin, let’s open the LivePortrait setup and installation instructions, as a reference to follow along to, and an easy source to copy and paste the numerous bits of syntax, that we’ll need during the installation process.
To make it even easier for you, I’ve numbered and listed each of the bits of syntax that you’ll need to copy and paste, to save you the hassle of referring back to the LivePortrait GitHub page. I’ve put these in order in the description below for you. During the video, I’ll display the syntax reference number and syntax, that you can then find in the description quickly and easily.
Anyway, open the LivePortrait GitHub page in your browser. I’ll leave the URL link in the description below for you.
Then scroll down the page a bit, to the “Getting Started” section.
We’ll keep things simple for this end-to-end install and follow the recommended process to install LivePortrait, and all of its dependencies, so that we end up with a clean install without errors, that just runs and works correctly.
Anyway, let’s get stuck into the complete end-to-end LivePortrait installation.
Install Git
The first step is to install Git, so that we can clone the LivePortrait GitHub Repository to our PC.
If you already have Git installed, then you can jump to the next section.
Open the Git page in your browser. I’ll leave the URL link in the description below for you.
Click on the Download for Windows button.
This will open up the Windows download page.
We want to download the Standalone Installer, which comes in 32-bit or 64-bit Windows versions.
I’m running a 64-bit version of Windows, so I’ll click the “64-bit Git for Windows Setup” link.
On the Save As window, navigate to where you want to save the file.
I’ll just save it in my E drive.
Then click the Save button.
Once the file has downloaded, we’ll navigate to my E drive, and double-click the “Git dot exe” file to run the installer.
Just click the “Next” button, on the first 14 windows that pop up, to accept the Git default installation settings.
Click the “Install” button on the last window.
Once the installation has finished, untick the “View Release Notes” checkbox, and click the “Finish” button.
That’s it. Git has now been installed. Onto the next step.
Clone LivePortrait GitHub Repository
Next, we need copy the LivePortrait GitHub folders and files onto our PC.
Decide where you want to install all the files for LivePortrait.
I want to install them on my E drive.
I usually create a parent folder for each application, and then keep everything for that application in there.
However, during the LivePortrait cloning process, a LivePortrait parent folder is automatically created, so I’ll just clone LivePortrait directly into the root of my E drive.
Anyway, I’ll navigate to my E drive, then click into the address bar and type in “cmd”, and press “Enter”.
This will open the Command Prompt.
Switch back to the LivePortrait GitHub page, and select and copy the “git clone” syntax. Don’t use the small copy icon, as that will copy the whole block of text.
Then switch back to the Command Prompt, and paste the copied syntax at the prompt, and press “Enter”.
The cloning process won’t take very long.
Once it’s completed, we can close the Command Prompt.
If we go back to File Explorer, we can see a new folder in the root of my E drive, named “LivePortrait”, and if we open it, we can see all the cloned files and folders in there.
OK. Everything looks good. Onto the next step.
Install Miniconda and Add to Path
Next, we’ll need to install Miniconda, which is a streamlined version of Anaconda, which we’ll use to create the required environment, and handle the different packages required for LivePortrait.
If you already have Anaconda or Miniconda installed, then you can skip to the next section.
Open the Miniconda webpage in your browser. I’ll leave the URL link in the description below for you.
Scroll down the page a bit, to the “Latest Miniconda installer links” section.
We’re NOT going to download the latest Miniconda version from here, as it comes bundled with the latest release of Python, which we don’t need for LivePortrait, and it will cause errors when we go to launch LivePortrait. LivePortrait only requires Python version 3.9.18.
Instead, we’ll click on the text link “Other installer links”, which opens up the page for the latest Miniconda installer, bundled with previous Python versions.
Scroll down the page a bit and find the “Python 3.10” version. Then click the “Miniconda3 Windows 64-bit” link to the right.
On the Save As window, navigate to where you want to save the file.
I’ll select the root of my E drive, and then click the Save button.
Once the file has downloaded, we’ll navigate to my E drive, and double-click the “Miniconda dot exe” file to start the installation.
Click “Next” on the 1st setup window, and “I Agree” on the next window.
On the next window, choose whether you want to install for just you or for all users, I’ll select “Just Me”, and then click “Next”.
The next window shows the default installation directory, that Miniconda will be installed into. It’s worth making a mental note of this location, as we’ll need to select it later on.
If you selected to install it for “Just Me”, then the Miniconda installation folder will be under your username. If you selected to install it for all users, then it will install in the ProgramData folder.
Anyway, click “Next” to install in the default installation directory.
Then, on the next window, tick the last checkbox, to clear the cache and free up some disk space after installation, then click “Install”.
Once the installation has completed, click “Next”.
Untick the two checkboxes on the last window and click “Finish”.
To fully complete the installation, we need to add Anaconda to Path, for it to be recognised by our system.
In the Windows Search box, type “edit” and you should see “Edit the system environment variables” in the list of results.
Click it, and a “Systems Properties” window will pop up.
Make sure that the “Advanced” tab is selected, and towards the bottom of the window, click the “Environment Variables” button.
The “Environment Variables” window will pop up.
The “User variables” box at the top, is to make changes that will only be available to the current user. If you want Anaconda to be available to all users, then you’ll need to make your selections from the “Systems variables” box below.
I only want it to be available to me, so we’ll use the first “User variables” box.
In the top “User variables” box, we’ll select the “Path” variable, and click “Edit”.
The “Edit environment variable” window will pop up.
Now we need to navigate to the Miniconda installation folder location, that we made a mental note of earlier.
As I installed it for “Just Me”, I’ll navigate to my C drive, then Users, then my username, then double-click and open the newly installed “miniconda3” folder.
If we look down the folders list, we can see a folder named “Scripts”.
We’ll double-click it, to open it.
This folder contains the “conda dot exe” file, so this is the folder path that we want to copy.
Click into the address bar, right-click and select “copy”.
Go back to the “Edit environment variable” window.
Click “New”, and paste the copied path in, and press “Enter”.
Then we just click the OK button, and the next OK button, and the next OK button.
OK. That should be Miniconda all setup and ready to use.
We’ll just have a quick check to make sure everything is good.
In the Windows search box, type in “cmd”, and then select “Command Prompt” to launch it.
At the prompt, type in “conda, then a space, then, dash dash version”, and then press “Enter”.
Conda version 24.5.0 should be returned.
If this is the case, then Miniconda is now correctly fully installed, and we can close the Command Prompt.
OK. Onto the next step.
Create LivePortrait Environment Using Conda
Now we need to create a LivePortrait environment and specify Python version 3.9.18 to use.
Go back to File Explorer, and select and open the LivePortrait install folder.
In the address bar, type in “cmd”, and press “Enter”, to open the Command Prompt in the LivePortrait directory.
Switch back to the LivePortrait GitHub page in your browser.
Select and copy the first line of “create” syntax under the “create environment using conda” heading. Go back to the Command Prompt window, and at the prompt, paste in the copied syntax, and press “Enter”.
The package details will be shown for download and install, and the path of the new environment will be shown towards the top, which by default is created under your username.
At the “Proceed” prompt, type “y” to proceed, and then press “Enter”.
Once the packages have been downloaded and installed, the Command Prompt will return to the starting prompt state.
We now need to activate the environment that we just created.
Switch back to the LivePortrait GitHub page in your browser.
Select and copy the next line of “activate” syntax. Go back to the Command Prompt and paste the copied syntax at the prompt, and press “Enter”.
If you get an error, saying: “CondaError: Run ‘conda init’ before ‘conda activate’”, then at the prompt just type “conda init”, and press “Enter”. Then you need to close the Command Prompt window, go back into your LivePortrait folder, type in “cmd” in the address bar to launch the Command Prompt again, and then at the prompt paste in the “conda activate LivePortrait” syntax again, and press Enter. This should solve the error.
Anyway, once the environment has been successfully activated, your prompt will now have “LivePortrait” in brackets, before the standard prompt.
So far, so good. Onto the next step.
Install LivePortrait Dependencies with PIP
The final Conda step is to install all the required dependencies.
Go back to the LivePortrait GitHub page, and copy the next line of syntax, to copy the requirements.
Then switch back to the Command Prompt.
If, for any reason, you closed and re-opened your Command Prompt window, since the last step, and the prompt doesn’t have “LivePortrait” in brackets, before the standard prompt, then you need to re-activate the environment as we did before, by typing in “conda activate LivePortrait”, and press Enter. Then the “LivePortrait” in brackets will appear.
Anyway, paste the copied syntax at the prompt, and press “Enter”.
It’ll take a bit of time to download and install all of the required files.
If you want to see the full list of the required files, just open your LivePortrait folder and open the “requirements dot txt” file.
Anyway, let’s close that, and go back to the Command Prompt window to wait for the process to finish.
When it completes, it will return to the starting prompt state.
We can now close the Command Prompt.
OK. All done. Onto the next step.
Download LivePortrait Pre-trained Weights
The next step is to download two pre-trained weights folders, and move them into the correct LivePortrait folder.
Go back to the LivePortrait GitHub page.
Under step 2, “Download pretrained weights”, click the Google Drive link. I’ll leave the link to this Google Drive folder, in the description below for you.
The Google Drive will open and have two folders in there. A “liveportrait” folder and an “insightface” folder.
If we click into these folders, we can see that they both contain a number of required models for LivePortrait.
Anyway, go back to the original two folders location and click the download icon to the right of the “liveportrait” folder.
The folder is quite large, so you won’t see the Save As window pop up for a bit, as the folder is being prepared and zipped for download, which you can see happening in the bottom right of the screen.
When the Save As window does pop up, navigate to and open your “LivePortrait” folder, then the “pretrained_weights” folder, and then click “Save”.
Download and save the other “insightface” folder the same way, and into the same location.
When both files have finished downloading, navigate to and open the “pretrained_weights” download folder.
You’ll see the two downloaded dot zip files in there.
We need to unzip them directly into this same folder.
Right-click the “liveportrait” file, then select “Extract All”, then we’ll click the “browse” button and navigate to our “pretrained_weights” folder, then hit the “Extract” button.
Then we do exactly the same thing for the “insightface” file.
OK, once both files have been extracted, we can select the original downloaded zip files and delete them, to free up some space.
OK. That’s the pre-trained weights done. Onto the next step.
Install FFmpeg
To run LivePotrait, we’ll need to have FFmpeg installed.
Many of you will already have FFmpeg installed on your computer, so you can just skip to the next step if you do.
If you’re not sure if you have FFmpeg installed, when you go to run LivePortrait in the next step, you’ll see an error message telling you that you don’t have it installed, and you can then come back to this step to install it.
Or to check if you have FFmpeg installed on your computer, open a Command Prompt, and at the prompt type in “ffmpeg”, and press “Enter”.
If you get an error message, like the one shown on the screen, then you don’t have FFmpeg installed.
Anyway, on with the FFmpeg installation.
Open the FFmpeg webpage in your browser. I’ll leave the URL link in the description below for you.
Click the big green “Download” button, to be taken to the download page.
Scroll down a little bit, to the “Get packages & executable files” section.
Click the Windows icon, and the Windows specific download links will be shown below.
You can choose either of the download source options, but we’ll stick with the first one, from “gyan dot dev”.
Click the first link, and the “gyan dot dev FFmpeg Builds” page will open.
Scroll down a bit, past the first “git master builds” section, to the “release builds” section. These are not the very latest builds, but are more tested and stable, so we’ll stick with these.
In the top box, there’s an “essentials” build and a “full” build.
If you want to know the specific differences of each build type, then take a look at the bottom of the page for the full details.
Anyway, we want the “ffmpeg release full 7 zip” file, so we’ll click that link.
On the Save As window, we’ll navigate to my E drive again, and click “Save”.
When the file has finished downloading, we’ll navigate to my E drive.
We then right-click on the downloaded file and select “Extract All”. I want to extract it directly to my E drive, so I’ll browse to the root of my E drive, click “Select Folder”, and then click “Extract”.
When the extraction process has completed, we can select the original downloaded 7 zip file and delete it to save some disk space.
We’ll select the extracted folder and rename it to “FFmpeg” for simplicity and future-proofing, if we upgrade the FFmpeg file versions in the future.
We’ll move this FFmpeg folder directly to my C drive.
We’ll select and cut the FFmpeg folder, and open my C drive and paste it into the root of the drive.
OK, we’re nearly there.
To fully complete the installation, we need to add FFmpeg to Path, for it to be recognised by our system, in exactly the same way as we did for Anaconda before.
Open the “FFmpeg” folder on the C drive and then the “bin” folder. This contains the 3 important “FFmpeg dot exe” files, that we need to specify the path to.
Click into the address bar and copy the path to these files.
In the Windows Search box, type “edit” and you should see “Edit the system environment variables” in the list of results.
Click it, and a “Systems Properties” window will pop up.
Make sure that the “Advanced” tab is selected, and towards the bottom, click the “Environment Variables” button.
The “Environment Variables” window will pop up.
I only want FFmpeg to be available to me, so we’ll use the top “User variables” box.
In the top “User variables” box, we’ll select the “Path” variable, and click “Edit”.
The “Edit environment variable” window will pop up.
Click “New”, and paste the copied path in, and press “Enter”.
Then we just click the OK button, and the next OK button, and the next OK button.
OK. That should be FFmpeg all setup and ready to use.
We’ll just have a quick check to make sure everything’s good.
Open a Command Prompt, and at the prompt, type in “ffmpeg”, and press “Enter”. If you get a response, like the one shown on the screen, then FFmpeg has been installed and setup correctly, and we can close the Command Prompt window.
OK. Everything looks good, and you’ll be glad to know that we just completed the final installation step. That wasn’t so bad after all! Now onto launching LivePortrait.
Run LivePortrait via Gradio UI
You can run LivePortrait through a command line interface, or you can run it via a much more user friendly graphical user interface, using a Gradio UI, in your web browser.
I prefer the Gradio UI, so we’ll use that method.
Every time you want to launch LivePortrait, you’ll need to take the following same steps.
Navigate to and open your LivePortrait folder and launch the Command Prompt from there, by typing in “cmd” in the address bar, and pressing “Enter”.
At the prompt, we need to first activate the conda environment, by typing in “conda activate LivePortrait”, and press “Enter”.
Once the environment is correctly activated, you’ll see “LivePortrait” in brackets preceding the prompt.
Go back to the LivePortrait GitHub page, and scroll down to the Gradio Interface section.
Select and copy the first line of run syntax. Switch back to the Command Prompt, and at the prompt, paste in the copied syntax, and press “Enter”.
The necessary run files will load, and eventually a local URL will be shown, where LivePortrait is running.
Take a look at the next section to automate this process.
Anyway, then you just hold down your CTRL key on your keyboard, and click the URL in the Command Prompt window, to launch LivePortrait in your browser.
If the page that you can see on the screen is shown in your browser, then congratulations, you’ve successfully installed LivePortrait on your local Windows PC!
Auto Run LivePortrait via Gradio UI
I find it too much hassle, every time I want to open LivePortrait, to have to open the Command Prompt and then copy and paste the two different commands.
So, I created a quick script for myself, to do exactly that.
I thought it might be useful for some of you, so I’ll leave the syntax for the script in the description below, if you want to steal it. I’ll put it under SYNTAX 06.
Anyway, this is the simple script. It just has 3 sections.
To use it, go into your LivePortrait parent folder, and create a new text document there.
You can name the file anything you want, but I named mine “run”, so we’ll use that.
Anyway, delete the default new file name, including the dot txt file extension, and rename the file to “run” with a “dot bat” at the end, and press Enter.
Confirm you want to change the file type from a dot txt to a dot bat, by clicking “Yes”.
Right-click this new “run dot bat” file, and select “Edit in Notepad”.
Then copy the syntax in SYNTAX 06, in the description below, and paste it into the new file.
The only thing you need to change, is the location of your LivePortrait folder, on the third line. Make sure you only change the path, and not the cd forward slash d, at the start of the line.
I have my LivePortrait folder in the root of my E drive, but you’ll probably have yours somewhere different.
Once you’ve edited your LivePortrait path, then save the file.
Now when we want to run LivePortrait, we just double-click our new “run dot bat” file.
Then we CTRL and click the URL as usual.
Enable LivePortrait Dark Mode
Whilst we’re on the subject of tips and tricks, again if you’re like me, and prefer a dark theme for your web UI instead of the standard light theme, then you can always append the standard syntax onto the end of the URL in your address bar, and then press “Enter”.
Again, I’ll leave this SYNTAX 07 in the description below for you.
Once you’ve done it once, then next time you launch in light mode, just add a forward slash to the URL and the full dark theme URL will appear below for you to select.
Conclusion
Now you know the recommended and complete way to install LivePortrait on your Windows PC, with a couple of handy tips thrown in for safe measure.
Now go play!
Anyway, hope you found this video helpful, and I’ll catch you in the next one.
Links
LivePortrait Website:
https://liveportrait.github.io/
LivePortrait GitHub Page:
https://github.com/KwaiVGI/LivePortrait
Download Git:
https://git-scm.com/
Download Miniconda:
https://docs.anaconda.com/miniconda/
Download Pre-trained Weights from Google Drive:
https://drive.google.com/drive/folders/1UtKgzKjFAOmZkhNK-OYT0caJ_w2XAnib
Download FFmpeg:
https://ffmpeg.org/
Syntax
SYNTAX 01:
git clone https://github.com/KwaiVGI/LivePortrait
SYNTAX 02:
conda create -n LivePortrait python==3.9.18
SYNTAX 03:
conda activate LivePortrait
SYNTAX 04:
pip install -r requirements.txt
SYNTAX 05:
python app.py
SYNTAX 06 (paste into new “run.bat”, change path and save in LivePortrait folder):
@echo off
rem Step 1: Change directory to E:\LivePortrait
cd /d E:\LivePortrait
rem Step 2: Activate the conda environment
call conda activate LivePortrait
rem Step 3: Run your application
python app.py
SYNTAX 07:
/?__theme=dark