LivePortrait is a free, open-source AI tool that makes a still portrait copy the head movements and facial expressions of a "driving" video. It was developed by researchers at Kuaishou Technology, and it runs on your own PC rather than in a cloud app. This guide follows the project's own README and Windows package listing.
Only animate photos of people who have agreed to it, and don't use the results to mislead anyone. Animated faces are easy to mistake for real footage.
What you need
A Windows or Linux PC with an NVIDIA graphics card. The README gives install steps for Linux and Windows using CUDA builds of PyTorch, and says Animals mode is only tested on Linux and Windows with an NVIDIA GPU. macOS on Apple Silicon is supported for Humans mode, but the developers warn it may be about 20 times slower than an RTX 4090.
A clear, front-facing source photo of the face you want to animate.
A driving video of a face making the movements you want, or one of the example clips that ship with LivePortrait.
FFmpeg, which the README lists as a requirement for the manual install.
The README doesn't publish a minimum VRAM figure. Our suggestion: a 12GB card such as the ASUS RTX 3060 12GB Dual Gaming OC V2 or a 16GB card such as the Gigabyte 5060 Ti 16GB gives you headroom if you also want to run other AI video tools. Our VRAM guide explains how much memory different AI jobs tend to need.
Option 1: the Windows one-click package
The easiest route on Windows is the developers' one-click package on Hugging Face (cleardusk/LivePortrait-Windows). The newest file listed there is LivePortrait-Windows-v20240829.zip, which the README says supports auto-updates.
Download the latest zip from the LivePortrait-Windows page on Hugging Face.
Unzip it to a folder with plenty of free space.
Double-click run_windows.bat, as the README describes, and wait for the interface to open in your browser.
Option 2: manual install
If you'd rather install it yourself, or you're on Linux, the README's steps are:
Install Git, Conda and FFmpeg.
Clone the repository and create a Python 3.10 environment: conda create -n LivePortrait python=3.10, then conda activate LivePortrait.
Install a CUDA build of PyTorch that matches your CUDA version, then run pip install -r requirements.txt. The README notes that on Windows some newer CUDA versions, such as 12.4 and 12.6, may cause problems, and suggests 11.8 for stability.
Download the pretrained weights into pretrained_weights with huggingface-cli download KlingTeam/LivePortrait --local-dir pretrained_weights --exclude "*.git*" "README.md" "docs".
Run python inference.py as a first test. If it works, you'll get animations/s6--d0_concat.mp4, showing the driving video, the input and the result side by side.
If PyTorch can't see your graphics card at this point, see our guide to fixing "CUDA not available" in PyTorch.
Animate your own photo
From the command line, point LivePortrait at your own source (-s) and driving video (-d), for example python inference.py -s my-photo.jpg -d my-driving-clip.mp4. You can also use a video as the source to edit a portrait video, a feature the developers added in July 2024.
For your own driving videos, the README recommends:
cropping to a 1:1 aspect ratio (such as 512 x 512), or adding --flag_crop_driving_video to crop automatically
keeping the frame focused on the head, with little shoulder movement
making sure the first frame shows a front-facing face with a neutral expression
LivePortrait can also save the motion from a driving video as a .pkl template. The developers say this speeds up inference and helps protect privacy, because you can reuse the motion without keeping the original video.
Use the Gradio interface
For a point-and-click interface, run python app.py (Humans mode). Since August 2024 the interface also includes image-driven mode, regional control and precise portrait editing, such as adjusting the pose or expression of a still image. Animals mode has its own interface (python app_animals.py), which the README says is only tested on Linux with an NVIDIA GPU.
On Linux, the --flag_do_torch_compile option triggers a one-off optimisation of about a minute, after which the developers say inference is 20-30% faster. They note it isn't supported on Windows or macOS.
How fast is it?
The developers' own figures, measured for a single frame on an RTX 4090 with torch.compile, put the largest stage (the SPADE generator) at 7.59ms and the warping module at 5.21ms, with the other modules under 1ms each. Those are the developers' numbers on a top-end card, not Forge PC results, and your own speed will depend on your GPU. You can run python speed.py to check each module on your own NVIDIA card.
Other ways to run LivePortrait
The README lists community projects that build on LivePortrait, including ComfyUI nodes (ComfyUI-LivePortraitKJ and ComfyUI-AdvancedLivePortrait), a Stable Diffusion WebUI extension, and FasterLivePortrait, a TensorRT version for real-time use. If you already use ComfyUI, see how to install ComfyUI on Windows. These are third-party projects, so check each one's own instructions.
Licence note
LivePortrait's code is released under the MIT licence, but its LICENSE file says the InsightFace detection models it uses are for non-commercial research only. If you want to use LivePortrait commercially, the developers say you should replace those detection models.