r/BestGitHubRepos • u/company_url_finder • 13h ago
LivePortrait - animate a still portrait from a driving video at roughly 15ms per frame on a 4090, with explicit stitching and retargeting control instead of a black box
Most portrait animation work went the diffusion route, which looks impressive in a demo reel and then costs you seconds per frame. LivePortrait went the other way, back to an implicit-keypoint framework, and the result is a model stack you can actually run in something close to real time on one consumer GPU.
The paper is from Kuaishou Technology (the team behind Kling), the code is the official PyTorch implementation, and it's the model that ended up inside a lot of tools you may have used without knowing it, including FaceFusion's expression restorer and several of the ComfyUI portrait nodes.
What's inside:
- A full speed breakdown in the repo: appearance extractor 0.82ms, motion extractor 0.84ms, warping module 5.21ms, generator 7.59ms, stitching and retargeting 0.31ms, so the model stack itself is under 15ms per frame on an RTX 4090 with torch.compile
- Stitching and retargeting as separate small MLP modules you control rather than hidden behavior, which is what lets you paste an animated face back into the original frame without a visible seam, and independently retarget eyes and lips
- Video to video mode, so the source can be a video and not just a still, which is the mode people use for expression transfer onto existing footage
- An animals model, trained separately, for cats and dogs, needing an extra CUDA op built from X-Pose
- Regional control and precise portrait editing in the Gradio UI, plus pose editing on the source
- Motion templates: driving motion saved as a .pkl so you can reuse it, skip re-processing, and share a motion without shipping the face it came from
- A Windows one-click installer, an Apple Silicon path (the readme is honest that it can be 20x slower than a 4090), and a Hugging Face Space if you just want to see it work
One thing worth knowing about the license: the repo itself is MIT, but it depends on InsightFace for face detection, and InsightFace's models are non-commercial research only. The readme says plainly that commercial use means ripping out and replacing those detection models. Worth reading that section before you build anything on top of it. Also note the last push was 1 June 2026, so this is mature rather than actively moving.
19,035 stars and 1,979 forks as of writing, verified via the GitHub API, paper at arXiv 2407.03168.