[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-KlingAIResearch--LivePortrait":3,"tool-KlingAIResearch--LivePortrait":64},[4,18,26,35,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,2,"2026-04-06T11:32:50",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[43,15,13,14],"语言模型",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,52],"视频",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85013,"2026-04-06T11:09:19",[15,16,52,61,13,62,43,14,63],"插件","其他","音频",{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":80,"owner_twitter":79,"owner_website":79,"owner_url":81,"languages":82,"stars":95,"forks":96,"last_commit_at":97,"license":98,"difficulty_score":99,"env_os":100,"env_gpu":101,"env_ram":102,"env_deps":103,"category_tags":114,"github_topics":115,"view_count":32,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":120,"updated_at":121,"faqs":122,"releases":157},5472,"KlingAIResearch\u002FLivePortrait","LivePortrait","Bring portraits to life!","LivePortrait 是一款高效的人像动画生成工具，旨在让静态照片“活”起来。只需提供一张人像照片和一段驱动视频（或动作序列），它就能精准捕捉面部表情与头部姿态，将其自然迁移到目标照片上，生成逼真流畅的动态视频。\n\n该工具主要解决了传统人像动画中常见的画面撕裂、表情僵硬及身份特征丢失等痛点。通过创新的“拼接（Stitching）”与“重定向（Retargeting）”控制技术，LivePortrait 能在保持人物原有外貌特征的同时，实现细腻的微表情还原和大幅度的头部运动，甚至支持猫、狗等动物形象的生动演绎。\n\n无论是希望快速制作趣味视频的普通用户、需要素材灵感的创作者与设计师，还是从事计算机视觉研究的开发者，都能从中受益。项目不仅提供了开箱即用的 Windows 一键安装包和在线演示，降低了使用门槛，其开源代码也为技术人员提供了深入的二次开发空间。凭借在效率与画质上的卓越平衡，LivePortrait 已成为快手、抖音等多个主流视频平台背后的技术支持之一，是探索数字人动画领域的优秀选择。","\u003Ch1 align=\"center\">LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control\u003C\u002Fh1>\n\n\u003Cdiv align='center'>\n    \u003Ca href='https:\u002F\u002Fgithub.com\u002Fcleardusk' target='_blank'>\u003Cstrong>Jianzhu Guo\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1*†\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fgithub.com\u002FMystery099' target='_blank'>\u003Cstrong>Dingyun Zhang\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1,2*\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fgithub.com\u002FKwaiVGI' target='_blank'>\u003Cstrong>Xiaoqiang Liu\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fgithub.com\u002Fzzzweakman' target='_blank'>\u003Cstrong>Zhizhou Zhong\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1,3\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fscholar.google.com.hk\u002Fcitations?user=_8k1ubAAAAAJ' target='_blank'>\u003Cstrong>Yuan Zhang\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1\u003C\u002Fsup>&emsp;\n\u003C\u002Fdiv>\n\n\u003Cdiv align='center'>\n    \u003Ca href='https:\u002F\u002Fscholar.google.com\u002Fcitations?user=P6MraaYAAAAJ' target='_blank'>\u003Cstrong>Pengfei Wan\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fopenreview.net\u002Fprofile?id=~Di_ZHANG3' target='_blank'>\u003Cstrong>Di Zhang\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1\u003C\u002Fsup>&emsp;\n\u003C\u002Fdiv>\n\n\u003Cdiv align='center'>\n    \u003Csup>1 \u003C\u002Fsup>Kuaishou Technology&emsp; \u003Csup>2 \u003C\u002Fsup>University of Science and Technology of China&emsp; \u003Csup>3 \u003C\u002Fsup>Fudan University&emsp;\n\u003C\u002Fdiv>\n\u003Cdiv align='center'>\n    \u003Csmall>\u003Csup>*\u003C\u002Fsup> Equal contributions\u003C\u002Fsmall>\n    \u003Csmall>\u003Csup>†\u003C\u002Fsup> Project lead\u003C\u002Fsmall>\n\u003C\u002Fdiv>\n\u003Cbr>\n\n\u003C!-- ===== LivePortrait – Quick Start & Links ===== -->\n\u003Cdiv align=\"center\">\n\n  \u003C!-- 🚀 Quick Start buttons -->\n  \u003Cp>\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows\u002Fblob\u002Fmain\u002FLivePortrait-Windows-v20240829.zip\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F🖥 Windows Installer-v20240829-00BFFF?style=for-the-badge&logo=windows&logoColor=white\" alt=\"Windows one-click installer\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FKlingTeam\u002FLivePortrait\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F🌐 Try Online Demo-FF6F00?style=for-the-badge&logo=huggingface&logoColor=white\" alt=\"HuggingFace online demo\">\u003C\u002Fa>\n  \u003C\u002Fp>\n\n  \u003C!-- 📄 Paper \u002F project \u002F GitHub stats -->\n  \u003Cp>\n    \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2407.03168\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-LivePortrait-red\" alt=\"arXiv link\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fliveportrait.github.io\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject-Homepage-green\" alt=\"project homepage\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FKlingTeam\u002FLivePortrait\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F🤗 Hugging Face-Spaces-blue\" alt=\"HF space\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fhellogithub.com\u002Frepository\u002Fbed652ef02154dd7a434e0720125639e\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fabroad.hellogithub.com\u002Fv1\u002Fwidgets\u002Frecommend.svg?rid=bed652ef02154dd7a434e0720125639e&claim_uid=XyBT2K9QJ7RZhej&theme=small\" alt=\"Featured by HelloGitHub\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FKlingTeam\u002FLivePortrait?style=social\" alt=\"GitHub stars\">\u003C\u002Fa>\n  \u003C\u002Fp>\n\n  \u003C!-- 🌏 Language switch -->\n  \u003Cp>\u003Cstrong>English\u003C\u002Fstrong> | \u003Ca href=\".\u002Freadme_zh_cn.md\">\u003Cstrong>简体中文\u003C\u002Fstrong>\u003C\u002Fa>\u003C\u002Fp>\n\n  \u003C!-- 🎬 Showcase GIF -->\n  \u003Cp>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_6c7767465ed1.gif\" alt=\"LivePortrait showcase GIF\">\u003C\u002Fp>\n  \u003Cp>🔥 For more results, visit our \u003Ca href=\"https:\u002F\u002Fliveportrait.github.io\u002F\" target=\"_blank\">\u003Cstrong>homepage\u003C\u002Fstrong>\u003C\u002Fa> 🔥\u003C\u002Fp>\n\n\u003C\u002Fdiv>\n\u003C!-- ===== \u002FLivePortrait ===== -->\n\n\n## 🔥 Updates\n- **`2025\u002F06\u002F01`**: 🌍 Over the past year, **LivePortrait** has 🚀 become an efficient portrait-animation (humans, cats and dogs) solution adopted by major video platforms—Kuaishou, Douyin, Jianying, WeChat Channels—as well as numerous startups and creators. 🎉\n- **`2025\u002F01\u002F01`**: 🐶 We updated a new version of the Animals model with more data, see [**here**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2025-01-01.md).\n- **`2024\u002F10\u002F18`**: ❗ We have updated the versions of the `transformers` and `gradio` libraries to avoid security vulnerabilities. Details [here](https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\u002Fpull\u002F421\u002Ffiles).\n- **`2024\u002F08\u002F29`**: 📦 We update the Windows [one-click installer](https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows\u002Fblob\u002Fmain\u002FLivePortrait-Windows-v20240829.zip) and support auto-updates, see [changelog](https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows#20240829).\n- **`2024\u002F08\u002F19`**: 🖼️ We support **image driven mode** and **regional control**. For details, see [**here**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2024-08-19.md).\n- **`2024\u002F08\u002F06`**: 🎨 We support **precise portrait editing** in the Gradio interface, inspired by [ComfyUI-AdvancedLivePortrait](https:\u002F\u002Fgithub.com\u002FPowerHouseMan\u002FComfyUI-AdvancedLivePortrait). See [**here**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2024-08-06.md).\n- **`2024\u002F08\u002F05`**: 📦 Windows users can now download the [one-click installer](https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows\u002Fblob\u002Fmain\u002FLivePortrait-Windows-v20240806.zip) for Humans mode and **Animals mode** now! For details, see [**here**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2024-08-05.md).\n- **`2024\u002F08\u002F02`**: 😸 We released a version of the **Animals model**, along with several other updates and improvements. Check out the details [**here**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2024-08-02.md)!\n- **`2024\u002F07\u002F25`**: 📦 Windows users can now download the package from [HuggingFace](https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows\u002Ftree\u002Fmain). Simply unzip and double-click `run_windows.bat` to enjoy!\n- **`2024\u002F07\u002F24`**: 🎨 We support pose editing for source portraits in the Gradio interface. We’ve also lowered the default detection threshold to increase recall. [Have fun](assets\u002Fdocs\u002Fchangelog\u002F2024-07-24.md)!\n- **`2024\u002F07\u002F19`**: ✨ We support 🎞️ **portrait video editing (aka v2v)**! More to see [here](assets\u002Fdocs\u002Fchangelog\u002F2024-07-19.md).\n- **`2024\u002F07\u002F17`**: 🍎 We support macOS with Apple Silicon, modified from [jeethu](https:\u002F\u002Fgithub.com\u002Fjeethu)'s PR [#143](https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\u002Fpull\u002F143).\n- **`2024\u002F07\u002F10`**: 💪 We support audio and video concatenating, driving video auto-cropping, and template making to protect privacy. More to see [here](assets\u002Fdocs\u002Fchangelog\u002F2024-07-10.md).\n- **`2024\u002F07\u002F09`**: 🤗 We released the [HuggingFace Space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FKlingTeam\u002FLivePortrait), thanks to the HF team and [Gradio](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio)!\n- **`2024\u002F07\u002F04`**: 😊 We released the initial version of the inference code and models. Continuous updates, stay tuned!\n- **`2024\u002F07\u002F04`**: 🔥 We released the [homepage](https:\u002F\u002Fliveportrait.github.io) and technical report on [arXiv](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2407.03168).\n\n\n\n## Introduction 📖\nThis repo, named **LivePortrait**, contains the official PyTorch implementation of our paper [LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2407.03168).\nWe are actively updating and improving this repository. If you find any bugs or have suggestions, welcome to raise issues or submit pull requests (PR) 💖.\n\n## Getting Started 🏁\n### 1. Clone the code and prepare the environment 🛠️\n\n> [!Note]\n> Make sure your system has [`git`](https:\u002F\u002Fgit-scm.com\u002F), [`conda`](https:\u002F\u002Fanaconda.org\u002Fanaconda\u002Fconda), and [`FFmpeg`](https:\u002F\u002Fffmpeg.org\u002Fdownload.html) installed. For details on FFmpeg installation, see [**how to install FFmpeg**](assets\u002Fdocs\u002Fhow-to-install-ffmpeg.md).\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\ncd LivePortrait\n\n# create env using conda\nconda create -n LivePortrait python=3.10\nconda activate LivePortrait\n```\n\n#### For Linux 🐧 or Windows 🪟 Users\n[X-Pose](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FX-Pose), required by Animals mode, is a dependency that needs to be installed. The step of `Check your CUDA versions` is **optional** if you only want to run Humans mode.\n\n\u003Cdetails>\n  \u003Csummary>Check your CUDA versions\u003C\u002Fsummary>\n\n  Firstly, check your current CUDA version by:\n  ```bash\n  nvcc -V # example versions: 11.1, 11.8, 12.1, etc.\n  ```\n\n  Then, install the corresponding torch version. Here are examples for different CUDA versions. Visit the [PyTorch Official Website](https:\u002F\u002Fpytorch.org\u002Fget-started\u002Fprevious-versions) for installation commands if your CUDA version is not listed:\n  ```bash\n  # for CUDA 11.1\n  pip install torch==1.10.1+cu111 torchvision==0.11.2 torchaudio==0.10.1 -f https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu111\u002Ftorch_stable.html\n  # for CUDA 11.8\n  pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n  # for CUDA 12.1\n  pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\n  # ...\n  ```\n\n  **Note**: On Windows systems, some higher versions of CUDA (such as 12.4, 12.6, etc.) may lead to unknown issues. You may consider downgrading CUDA to version 11.8 for stability. See the [downgrade guide](https:\u002F\u002Fgithub.com\u002Fdimitribarbot\u002Fsd-webui-live-portrait\u002Fblob\u002Fmain\u002Fassets\u002Fdocs\u002Fhow-to-install-xpose.md#cuda-toolkit-118) by [@dimitribarbot](https:\u002F\u002Fgithub.com\u002Fdimitribarbot).\n\u003C\u002Fdetails>\n\n\nFinally, install the remaining dependencies:\n```bash\npip install -r requirements.txt\n```\n\n#### For macOS  with Apple Silicon Users\nThe [X-Pose](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FX-Pose) dependency does not support macOS, so you can skip its installation. While Humans mode works as usual, Animals mode is not supported. Use the provided requirements file for macOS with Apple Silicon:\n```bash\n# for macOS with Apple Silicon users\npip install -r requirements_macOS.txt\n```\n\n### 2. Download pretrained weights 📥\n\nThe easiest way to download the pretrained weights is from HuggingFace:\n```bash\n# !pip install -U \"huggingface_hub[cli]\"\nhuggingface-cli download KlingTeam\u002FLivePortrait --local-dir pretrained_weights --exclude \"*.git*\" \"README.md\" \"docs\"\n```\n\nIf you cannot access to Huggingface, you can use [hf-mirror](https:\u002F\u002Fhf-mirror.com\u002F) to download:\n```bash\n# !pip install -U \"huggingface_hub[cli]\"\nexport HF_ENDPOINT=https:\u002F\u002Fhf-mirror.com\nhuggingface-cli download KlingTeam\u002FLivePortrait --local-dir pretrained_weights --exclude \"*.git*\" \"README.md\" \"docs\"\n```\n\nAlternatively, you can download all pretrained weights from [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F1UtKgzKjFAOmZkhNK-OYT0caJ_w2XAnib) or [Baidu Yun](https:\u002F\u002Fpan.baidu.com\u002Fs\u002F1MGctWmNla_vZxDbEp2Dtzw?pwd=z5cn). Unzip and place them in `.\u002Fpretrained_weights`.\n\nEnsuring the directory structure is as or contains [**this**](assets\u002Fdocs\u002Fdirectory-structure.md).\n\n### 3. Inference 🚀\n\n#### Fast hands-on (humans) 👤\n```bash\n# For Linux and Windows users\npython inference.py\n\n# For macOS users with Apple Silicon (Intel is not tested). NOTE: this maybe 20x slower than RTX 4090\nPYTORCH_ENABLE_MPS_FALLBACK=1 python inference.py\n```\n\nIf the script runs successfully, you will get an output mp4 file named `animations\u002Fs6--d0_concat.mp4`. This file includes the following results: driving video, input image or video, and generated result.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_546744c1ef24.gif\" alt=\"image\">\n\u003C\u002Fp>\n\nOr, you can change the input by specifying the `-s` and `-d` arguments:\n\n```bash\n# source input is an image\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs9.jpg -d assets\u002Fexamples\u002Fdriving\u002Fd0.mp4\n\n# source input is a video ✨\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs13.mp4 -d assets\u002Fexamples\u002Fdriving\u002Fd0.mp4\n\n# more options to see\npython inference.py -h\n```\n\n#### Fast hands-on (animals) 🐱🐶\nAnimals mode is ONLY tested on Linux and Windows with NVIDIA GPU.\n\nYou need to build an OP named `MultiScaleDeformableAttention` first (refer to the \u003Ca href=\"#for-linux--or-windows--users\">Check your CUDA versions\u003C\u002Fa> if needed), which is used by [X-Pose](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FX-Pose), a general keypoint detection framework.\n\n```bash\ncd src\u002Futils\u002Fdependencies\u002FXPose\u002Fmodels\u002FUniPose\u002Fops\npython setup.py build install\ncd - # equal to cd ..\u002F..\u002F..\u002F..\u002F..\u002F..\u002F..\u002F\n```\n\nThen\n```bash\npython inference_animals.py -s assets\u002Fexamples\u002Fsource\u002Fs39.jpg -d assets\u002Fexamples\u002Fdriving\u002Fwink.pkl --driving_multiplier 1.75 --no_flag_stitching\n```\nIf the script runs successfully, you will get an output mp4 file named `animations\u002Fs39--wink_concat.mp4`.\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_f1952d55be87.gif\" alt=\"image\">\n\u003C\u002Fp>\n\n#### Driving video auto-cropping 📢📢📢\n> [!IMPORTANT]\n> To use your own driving video, we **recommend**: ⬇️\n> - Crop it to a **1:1** aspect ratio (e.g., 512x512 or 256x256 pixels), or enable auto-cropping by `--flag_crop_driving_video`.\n> - Focus on the head area, similar to the example videos.\n> - Minimize shoulder movement.\n> - Make sure the first frame of driving video is a frontal face with **neutral expression**.\n\nBelow is an auto-cropping case by `--flag_crop_driving_video`:\n```bash\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs9.jpg -d assets\u002Fexamples\u002Fdriving\u002Fd13.mp4 --flag_crop_driving_video\n```\n\nIf you find the results of auto-cropping is not well, you can modify the `--scale_crop_driving_video`, `--vy_ratio_crop_driving_video` options to adjust the scale and offset, or do it manually.\n\n#### Motion template making\nYou can also use the auto-generated motion template files ending with `.pkl` to speed up inference, and **protect privacy**, such as:\n```bash\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs9.jpg -d assets\u002Fexamples\u002Fdriving\u002Fd5.pkl # portrait animation\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs13.mp4 -d assets\u002Fexamples\u002Fdriving\u002Fd5.pkl # portrait video editing\n```\n\n### 4. Gradio interface 🤗\n\nWe also provide a Gradio \u003Ca href='https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fgradio-app\u002Fgradio'>\u003C\u002Fa> interface for a better experience, just run by:\n\n```bash\n# For Linux and Windows users (and macOS with Intel??)\npython app.py # humans mode\n\n# For macOS with Apple Silicon users, Intel not supported, this maybe 20x slower than RTX 4090\nPYTORCH_ENABLE_MPS_FALLBACK=1 python app.py # humans mode\n```\n\nWe also provide a Gradio interface of animals mode, which is only tested on Linux with NVIDIA GPU:\n```bash\npython app_animals.py # animals mode 🐱🐶\n```\n\nYou can specify the `--server_port`, `--share`, `--server_name` arguments to satisfy your needs!\n\n🚀 We also provide an acceleration option `--flag_do_torch_compile`. The first-time inference triggers an optimization process (about one minute), making subsequent inferences 20-30% faster. Performance gains may vary with different CUDA versions.\n```bash\n# enable torch.compile for faster inference\npython app.py --flag_do_torch_compile\n```\n**Note**: This method is not supported on Windows and macOS.\n\n**Or, try it out effortlessly on [HuggingFace](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FKlingTeam\u002FLivePortrait) 🤗**\n\n### 5. Inference speed evaluation 🚀🚀🚀\nWe have also provided a script to evaluate the inference speed of each module:\n\n```bash\n# For NVIDIA GPU\npython speed.py\n```\n\nThe results are [**here**](.\u002Fassets\u002Fdocs\u002Fspeed.md).\n\n## Community Resources 🤗\n\nDiscover the invaluable resources contributed by our community to enhance your LivePortrait experience.\n\n\n### Community-developed Projects\n\n| Repo | Description | Author \u002F Links |\n|------|------|--------|\n| [**ditto-talkinghead**](https:\u002F\u002Fgithub.com\u002Fantgroup\u002Fditto-talkinghead) | Real-time audio-driven talking head. | [ArXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F2411.19509), [Homepage](https:\u002F\u002Fdigital-avatar.github.io\u002Fai\u002FDitto\u002F)  |\n| [**FasterLivePortrait**](https:\u002F\u002Fgithub.com\u002Fwarmshao\u002FFasterLivePortrait) | Faster real-time version using TensorRT. | [@warmshao](https:\u002F\u002Fgithub.com\u002Fwarmshao) |\n| [**AdvancedLivePortrait-WebUI**](https:\u002F\u002Fgithub.com\u002Fjhj0517\u002FAdvancedLivePortrait-WebUI) | Dedicated gradio based WebUI started from [ComfyUI-AdvancedLivePortrait](https:\u002F\u002Fgithub.com\u002FPowerHouseMan\u002FComfyUI-AdvancedLivePortrait). | [@jhj0517](https:\u002F\u002Fgithub.com\u002Fjhj0517) |\n| [**FacePoke**](https:\u002F\u002Fgithub.com\u002Fjbilcke-hf\u002FFacePoke) | A real-time head transformation app, controlled by your mouse! | [@jbilcke-hf](https:\u002F\u002Fgithub.com\u002Fjbilcke-hf) |\n| [**FaceFusion**](https:\u002F\u002Fgithub.com\u002Ffacefusion\u002Ffacefusion) | FaceFusion 3.0 integregates LivePortrait as `expression_restorer` and `face_editor` processors. | [@henryruhs](https:\u002F\u002Fgithub.com\u002Fhenryruhs) |\n| [**sd-webui-live-portrait**](https:\u002F\u002Fgithub.com\u002Fdimitribarbot\u002Fsd-webui-live-portrait) | WebUI extension of LivePortrait, adding atab to the original Stable Diffusion WebUI to benefit from LivePortrait features. | [@dimitribarbot](https:\u002F\u002Fgithub.com\u002Fdimitribarbot) |\n| [**ComfyUI-LivePortraitKJ**](https:\u002F\u002Fgithub.com\u002Fkijai\u002FComfyUI-LivePortraitKJ) | A ComfyUI node to use LivePortrait, with MediaPipe as as an alternative to Insightface. | [@kijai](https:\u002F\u002Fgithub.com\u002Fkijai) |\n| [**ComfyUI-AdvancedLivePortrait**](https:\u002F\u002Fgithub.com\u002FPowerHouseMan\u002FComfyUI-AdvancedLivePortrait) | A faster ComfyUI node with real-time preview that has inspired many other community-developed tools and projects. | [@PowerHouseMan](https:\u002F\u002Fgithub.com\u002FPowerHouseMan) |\n| [**comfyui-liveportrait**](https:\u002F\u002Fgithub.com\u002Fshadowcz007\u002Fcomfyui-liveportrait) | A ComfyUI node to use LivePortrait, supporting multi-faces, expression interpolation etc, with a [tutorial](https:\u002F\u002Fwww.bilibili.com\u002Fvideo\u002FBV1JW421R7sP). | [@shadowcz007](https:\u002F\u002Fgithub.com\u002Fshadowcz007) |\n\n### Playgrounds, 🤗 HuggingFace Spaces and Others\n- [FacePoke Space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fjbilcke-hf\u002FFacePoke)\n- [Expression Editor Space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ffffiloni\u002Fexpression-editor)\n- [Expression Editor Replicate](https:\u002F\u002Freplicate.com\u002Ffofr\u002Fexpression-editor)\n- [Face Control Realtime Demo](https:\u002F\u002Ffal.ai\u002Fdemos\u002Fface-control) on FAL\n- [Replicate Playground](https:\u002F\u002Freplicate.com\u002Ffofr\u002Flive-portrait)\n- Nuke can use LivePortrait through CompyUI node, details [here](https:\u002F\u002Fx.com\u002Fbilawalsidhu\u002Fstatus\u002F1837349806475276338)\n- LivePortrait lives on [Poe](https:\u002F\u002Fpoe.com\u002FLivePortrait)\n\n### Video Tutorials\n- [Workflow of LivePortrait Video to Video](https:\u002F\u002Fyoutu.be\u002FxfzK_6cTs58?si=aYjgypeJBkhc46VL) by [@curiousrefuge](https:\u002F\u002Fwww.youtube.com\u002F@curiousrefuge)\n- [Google Colab tutorial](https:\u002F\u002Fyoutu.be\u002F59Y9ePAXTp0?si=KzEWhklBlporW7D8) by [@Planet Ai](https:\u002F\u002Fwww.youtube.com\u002F@planetai217)\n- [Paper reading](https:\u002F\u002Fyoutu.be\u002FfD0P6UWSu8I?si=Vn5wxUa8qSu1jv4l) by [@TwoMinutePapers](https:\u002F\u002Fwww.youtube.com\u002F@TwoMinutePapers)\n- [ComfyUI Advanced LivePortrait](https:\u002F\u002Fyoutu.be\u002Fq0Vf-ZZsbzI?si=nbs3npleH-dVCt28) by [TutoView](https:\u002F\u002Fwww.youtube.com\u002F@TutoView)\n- [LivePortarit exploration](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=vsvlbTEqgXQ) and [A deep dive into LivePortrait](https:\u002F\u002Fyoutu.be\u002FcucaEEDYmsw?si=AtPaDWc5G-a4E8dD) by [TheoreticallyMedia](https:\u002F\u002Fwww.youtube.com\u002F@TheoreticallyMedia)\n- [LivePortrait hands-on tutorial](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=uyjSTAOY7yI) by [@AI Search](https:\u002F\u002Fwww.youtube.com\u002F@theAIsearch)\n- [ComfyUI tutorial](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=8-IcDDmiUMM) by [@Sebastian Kamph](https:\u002F\u002Fwww.youtube.com\u002F@sebastiankamph)\n- A [tutorial](https:\u002F\u002Fwww.bilibili.com\u002Fvideo\u002FBV1cf421i7Ly) on BiliBili\n\nAnd so MANY amazing contributions from our community, too many to list them all 💖\n\n## Acknowledgements 💐\nWe would like to thank the contributors of [FOMM](https:\u002F\u002Fgithub.com\u002FAliaksandrSiarohin\u002Ffirst-order-model), [Open Facevid2vid](https:\u002F\u002Fgithub.com\u002Fzhanglonghao1992\u002FOne-Shot_Free-View_Neural_Talking_Head_Synthesis), [SPADE](https:\u002F\u002Fgithub.com\u002FNVlabs\u002FSPADE), [InsightFace](https:\u002F\u002Fgithub.com\u002Fdeepinsight\u002Finsightface) and [X-Pose](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FX-Pose) repositories, for their open research and contributions.\n\n## Ethics Considerations 🛡️\nPortrait animation technologies come with social risks, particularly the potential for misuse in creating deepfakes. To mitigate these risks, it’s crucial to follow ethical guidelines and adopt responsible usage practices. At present, the synthesized results contain visual artifacts that may help in detecting deepfakes. Please note that we do not assume any legal responsibility for the use of the results generated by this project.\n\n## Citation 💖\nIf you find LivePortrait useful for your project or research, welcome to 🌟 this repo and cite our work using the following BibTeX:\n```bibtex\n@article{guo2024liveportrait,\n  title   = {LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control},\n  author  = {Guo, Jianzhu and Zhang, Dingyun and Liu, Xiaoqiang and Zhong, Zhizhou and Zhang, Yuan and Wan, Pengfei and Zhang, Di},\n  journal = {arXiv preprint arXiv:2407.03168},\n  year    = {2024}\n}\n```\n\n*Long live in arXiv.*\n\n## Contact 📧\n[**Jianzhu Guo (郭建珠)**](https:\u002F\u002Fguojianzhu.com); **guojianzhu1994@gmail.com**\n\n## Star History 🌟\n\u003Cdetails>\n  \u003Csummary>Click to view Star chart\u003C\u002Fsummary>\n  \u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fwww.star-history.com\u002F#KlingAIResearch\u002FLivePortrait&Timeline\" target=\"_blank\">\n      \u003Cpicture>\n        \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_61d17bf1b101.png&theme=dark\" \u002F>\n        \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_61d17bf1b101.png\" \u002F>\n        \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_61d17bf1b101.png\" width=\"90%\" \u002F>\n      \u003C\u002Fpicture>\n    \u003C\u002Fa>\n  \u003C\u002Fp>\n\u003C\u002Fdetails>\n","\u003Ch1 align=\"center\">LivePortrait：基于拼接与重定向控制的高效人像动画\u003C\u002Fh1>\n\n\u003Cdiv align='center'>\n    \u003Ca href='https:\u002F\u002Fgithub.com\u002Fcleardusk' target='_blank'>\u003Cstrong>郭建竹\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1*†\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fgithub.com\u002FMystery099' target='_blank'>\u003Cstrong>张丁云\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1,2*\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fgithub.com\u002FKwaiVGI' target='_blank'>\u003Cstrong>刘晓强\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fgithub.com\u002Fzzzweakman' target='_blank'>\u003Cstrong>钟志周\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1,3\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fscholar.google.com.hk\u002Fcitations?user=_8k1ubAAAAAJ' target='_blank'>\u003Cstrong>张源\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1\u003C\u002Fsup>&emsp;\n\u003C\u002Fdiv>\n\n\u003Cdiv align='center'>\n    \u003Ca href='https:\u002F\u002Fscholar.google.com\u002Fcitations?user=P6MraaYAAAAJ' target='_blank'>\u003Cstrong>万鹏飞\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1\u003C\u002Fsup>&emsp;\n    \u003Ca href='https:\u002F\u002Fopenreview.net\u002Fprofile?id=~Di_ZHANG3' target='_blank'>\u003Cstrong>张迪\u003C\u002Fstrong>\u003C\u002Fa>\u003Csup> 1\u003C\u002Fsup>&emsp;\n\u003C\u002Fdiv>\n\n\u003Cdiv align='center'>\n    \u003Csup>1 \u003C\u002Fsup>快手科技&emsp; \u003Csup>2 \u003C\u002Fsup>中国科学技术大学&emsp; \u003Csup>3 \u003C\u002Fsup>复旦大学&emsp;\n\u003C\u002Fdiv>\n\u003Cdiv align='center'>\n    \u003Csmall>\u003Csup>*\u003C\u002Fsup> 共同第一作者\u003C\u002Fsmall>\n    \u003Csmall>\u003Csup>†\u003C\u002Fsup> 项目负责人\u003C\u002Fsmall>\n\u003C\u002Fdiv>\n\u003Cbr>\n\n\u003C!-- ===== LivePortrait – 快速入门与链接 ===== -->\n\u003Cdiv align=\"center\">\n\n  \u003C!-- 🚀 快速入门按钮 -->\n  \u003Cp>\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows\u002Fblob\u002Fmain\u002FLivePortrait-Windows-v20240829.zip\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F🖥 Windows 安装包-v20240829-00BFFF?style=for-the-badge&logo=windows&logoColor=white\" alt=\"Windows 一键安装包\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FKlingTeam\u002FLivePortrait\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F🌐 在线演示-FF6F00?style=for-the-badge&logo=huggingface&logoColor=white\" alt=\"HuggingFace 在线演示\">\u003C\u002Fa>\n  \u003C\u002Fp>\n\n  \u003C!-- 📄 论文 \u002F 项目 \u002F GitHub 统计 -->\n  \u003Cp>\n    \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2407.03168\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-LivePortrait-red\" alt=\"arXiv 链接\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fliveportrait.github.io\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F项目-主页-green\" alt=\"项目主页\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FKlingTeam\u002FLivePortrait\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F🤗 Hugging Face-Spaces-blue\" alt=\"HF 空间\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fhellogithub.com\u002Frepository\u002Fbed652ef02154dd7a434e0720125639e\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fabroad.hellogithub.com\u002Fv1\u002Fwidgets\u002Frecommend.svg?rid=bed652ef02154dd7a434e0720125639e&claim_uid=XyBT2K9QJ7RZhej&theme=small\" alt=\"HelloGitHub 推荐\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FKlingTeam\u002FLivePortrait?style=social\" alt=\"GitHub 星标\">\u003C\u002Fa>\n  \u003C\u002Fp>\n\n  \u003C!-- 🌏 语言切换 -->\n  \u003Cp>\u003Cstrong>English\u003C\u002Fstrong> | \u003Ca href=\".\u002Freadme_zh_cn.md\">\u003Cstrong>简体中文\u003C\u002Fstrong>\u003C\u002Fa>\u003C\u002Fp>\n\n  \u003C!-- 🎬 展示 GIF -->\n  \u003Cp>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_6c7767465ed1.gif\" alt=\"LivePortrait 展示 GIF\">\u003C\u002Fp>\n  \u003Cp>🔥 更多效果，请访问我们的 \u003Ca href=\"https:\u002F\u002Fliveportrait.github.io\u002F\" target=\"_blank\">\u003Cstrong>主页\u003C\u002Fstrong>\u003C\u002Fa> 🔥\u003C\u002Fp>\n\n\u003C\u002Fdiv>\n\u003C!-- ===== \u002FLivePortrait ===== -->\n\n\n## 🔥 更新\n- **`2025\u002F06\u002F01`**: 🌍 过去一年里，**LivePortrait** 已经🚀成为各大视频平台（如快手、抖音、剪映、微信视频号）以及众多初创公司和创作者广泛采用的高效人像动画解决方案。🎉\n- **`2025\u002F01\u002F01`**: 🐶 我们更新了动物模型的新版本，使用了更多数据，详情请见[**这里**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2025-01-01.md)。\n- **`2024\u002F10\u002F18`**: ❗ 我们已更新 `transformers` 和 `gradio` 库的版本，以避免安全漏洞。详细信息请见[此处](https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\u002Fpull\u002F421\u002Ffiles)。\n- **`2024\u002F08\u002F29`**: 📦 我们更新了 Windows [一键安装包](https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows\u002Fblob\u002Fmain\u002FLivePortrait-Windows-v20240829.zip)，并支持自动更新，详情请见[变更日志](https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows#20240829)。\n- **`2024\u002F08\u002F19`**: 🖼️ 我们新增了**图像驱动模式**和**区域控制**功能。详情请见[**这里**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2024-08-19.md)。\n- **`2024\u002F08\u002F06`**: 🎨 我们在 Gradio 界面中支持**精确的人像编辑**功能，灵感来源于 [ComfyUI-AdvancedLivePortrait](https:\u002F\u002Fgithub.com\u002FPowerHouseMan\u002FComfyUI-AdvancedLivePortrait)。详情请见[**这里**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2024-08-06.md)。\n- **`2024\u002F08\u002F05`**: 📦 Windows 用户现在可以下载适用于人类模式和**动物模式**的[一键安装包](https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows\u002Fblob\u002Fmain\u002FLivePortrait-Windows-v20240805.zip)！详情请见[**这里**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2024-08-05.md)。\n- **`2024\u002F08\u002F02`**: 😸 我们发布了**动物模型**版本，并伴随多项更新和改进。详情请见[**这里**](.\u002Fassets\u002Fdocs\u002Fchangelog\u002F2024-08-02.md)！\n- **`2024\u002F07\u002F25`**: 📦 Windows 用户现在可以从 [HuggingFace](https:\u002F\u002Fhuggingface.co\u002Fcleardusk\u002FLivePortrait-Windows\u002Ftree\u002Fmain) 下载安装包。只需解压并双击 `run_windows.bat` 即可开始使用！\n- **`2024\u002F07\u002F24`**: 🎨 我们在 Gradio 界面中支持对源人像进行姿态编辑。同时，我们降低了默认检测阈值以提高召回率。[尽情体验吧](assets\u002Fdocs\u002Fchangelog\u002F2024-07-24.md)！\n- **`2024\u002F07\u002F19`**: ✨ 我们新增了🎥 **人像视频编辑（即 v2v）**功能！更多内容请见[**这里**](assets\u002Fdocs\u002Fchangelog\u002F2024-07-19.md)。\n- **`2024\u002F07\u002F17`**: 🍎 我们支持搭载 Apple Silicon 芯片的 macOS 系统，该实现基于 [jeethu](https:\u002F\u002Fgithub.com\u002Fjeethu) 的 PR [#143](https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\u002Fpull\u002F143) 修改而成。\n- **`2024\u002F07\u002F10`**: 💪 我们新增了音视频拼接、视频自动裁剪以及模板制作等功能，以保护用户隐私。更多细节请见[**这里**](assets\u002Fdocs\u002Fchangelog\u002F2024-07-10.md)。\n- **`2024\u002F07\u002F09`**: 🤗 我们上线了 [HuggingFace Space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FKlingTeam\u002FLivePortrait)，感谢 HF 团队和 [Gradio](https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio) 的支持！\n- **`2024\u002F07\u002F04`**: 😊 我们发布了推理代码和模型的初始版本。后续将持续更新，敬请关注！\n- **`2024\u002F07\u002F04`**: 🔥 我们同时发布了[项目主页](https:\u002F\u002Fliveportrait.github.io)以及在 [arXiv](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2407.03168) 上的技术报告。\n\n\n\n## 简介 📖\n本仓库名为 **LivePortrait**，包含了我们论文《LivePortrait：基于拼接与重定向控制的高效人像动画》（https:\u002F\u002Farxiv.org\u002Fpdf\u002F2407.03168）的官方 PyTorch 实现。\n我们正在积极维护和改进此仓库。如果您发现任何问题或有改进建议，欢迎提出 issue 或提交 pull request (PR) 💖。\n\n## 快速入门 🏁\n\n### 1. 克隆代码并准备环境 🛠️\n\n> [!提示]\n> 请确保您的系统已安装 [`git`](https:\u002F\u002Fgit-scm.com\u002F)、[`conda`](https:\u002F\u002Fanaconda.org\u002Fanaconda\u002Fconda) 和 [`FFmpeg`](https:\u002F\u002Fffmpeg.org\u002Fdownload.html)。有关 FFmpeg 的安装详情，请参阅 [**如何安装 FFmpeg**](assets\u002Fdocs\u002Fhow-to-install-ffmpeg.md)。\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\ncd LivePortrait\n\n# 使用 conda 创建环境\nconda create -n LivePortrait python=3.10\nconda activate LivePortrait\n```\n\n#### 对于 Linux 🐧 或 Windows 🪟 用户\nAnimals 模式所需的依赖库 [X-Pose](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FX-Pose) 需要单独安装。如果您仅想运行 Humans 模式，则 `检查 CUDA 版本` 这一步骤是 **可选** 的。\n\n\u003Cdetails>\n  \u003Csummary>检查 CUDA 版本\u003C\u002Fsummary>\n\n  首先，通过以下命令检查当前的 CUDA 版本：\n  ```bash\n  nvcc -V # 示例版本：11.1、11.8、12.1 等。\n  ```\n\n  然后，根据 CUDA 版本安装对应的 PyTorch 版本。以下是不同 CUDA 版本的示例。如果您的 CUDA 版本未列出，请访问 [PyTorch 官方网站](https:\u002F\u002Fpytorch.org\u002Fget-started\u002Fprevious-versions)获取安装命令：\n  ```bash\n  # 对于 CUDA 11.1\n  pip install torch==1.10.1+cu111 torchvision==0.11.2 torchaudio==0.10.1 -f https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu111\u002Ftorch_stable.html\n  # 对于 CUDA 11.8\n  pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n  # 对于 CUDA 12.1\n  pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\n  # ...\n  ```\n\n  **注意**：在 Windows 系统上，某些较高版本的 CUDA（如 12.4、12.6 等）可能会导致未知问题。为了稳定性，您可以考虑将 CUDA 降级至 11.8 版本。请参考 [@dimitribarbot](https:\u002F\u002Fgithub.com\u002Fdimitribarbot) 提供的 [降级指南](https:\u002F\u002Fgithub.com\u002Fdimitribarbot\u002Fsd-webui-live-portrait\u002Fblob\u002Fmain\u002Fassets\u002Fdocs\u002Fhow-to-install-xpose.md#cuda-toolkit-118)。\n\u003C\u002Fdetails>\n\n\n最后，安装剩余的依赖项：\n```bash\npip install -r requirements.txt\n```\n\n#### 对于搭载 Apple Silicon 的 macOS  用户\n[X-Pose](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FX-Pose) 依赖库不支持 macOS，因此可以跳过其安装。Humans 模式仍可正常使用，但 Animals 模式则不受支持。请使用为搭载 Apple Silicon 的 macOS 准备的依赖文件：\n```bash\n# 对于搭载 Apple Silicon 的 macOS 用户\npip install -r requirements_macOS.txt\n```\n\n### 2. 下载预训练权重 📥\n\n下载预训练权重最简单的方式是从 HuggingFace 获取：\n```bash\n# !pip install -U \"huggingface_hub[cli]\"\nhuggingface-cli download KlingTeam\u002FLivePortrait --local-dir pretrained_weights --exclude \"*.git*\" \"README.md\" \"docs\"\n```\n\n如果您无法访问 HuggingFace，可以使用 [hf-mirror](https:\u002F\u002Fhf-mirror.com\u002F) 来下载：\n```bash\n# !pip install -U \"huggingface_hub[cli]\"\nexport HF_ENDPOINT=https:\u002F\u002Fhf-mirror.com\nhuggingface-cli download KlingTeam\u002FLivePortrait --local-dir pretrained_weights --exclude \"*.git*\" \"README.md\" \"docs\"\n```\n\n或者，您也可以从 [Google Drive](https:\u002F\u002Fdrive.google.com\u002Fdrive\u002Ffolders\u002F1UtKgzKjFAOmZkhNK-OYT0caJ_w2XAnib) 或 [Baidu Yun](https:\u002F\u002Fpan.baidu.com\u002Fs\u002F1MGctWmNla_vZxDbEp2Dtzw?pwd=z5cn) 下载所有预训练权重。解压后将其放入 `.\u002Fpretrained_weights` 目录中。\n\n请确保目录结构与 [**此处**](assets\u002Fdocs\u002Fdirectory-structure.md) 一致或包含该结构。\n\n### 3. 推理 🚀\n\n#### 快速上手（人类） 👤\n```bash\n# 对于 Linux 和 Windows 用户\npython inference.py\n\n# 对于搭载 Apple Silicon 的 macOS 用户（尚未测试 Intel 版本）。注意：这可能比 RTX 4090 慢 20 倍\nPYTORCH_ENABLE_MPS_FALLBACK=1 python inference.py\n```\n\n如果脚本成功运行，您将得到一个名为 `animations\u002Fs6--d0_concat.mp4` 的输出 MP4 文件。该文件包含驱动视频、输入图像或视频以及生成的结果。\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_546744c1ef24.gif\" alt=\"图片\">\n\u003C\u002Fp>\n\n您也可以通过指定 `-s` 和 `-d` 参数来更改输入：\n\n```bash\n# 输入源为一张图片\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs9.jpg -d assets\u002Fexamples\u002Fdriving\u002Fd0.mp4\n\n# 输入源为一段视频 ✨\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs13.mp4 -d assets\u002Fexamples\u002Fdriving\u002Fd0.mp4\n\n# 更多选项请查看\npython inference.py -h\n```\n\n#### 快速上手（动物） 🐱🐶\nAnimals 模式仅在配备 NVIDIA 显卡的 Linux 和 Windows 系统上经过测试。\n\n您需要先构建一个名为 `MultiScaleDeformableAttention` 的 OP（如有需要，请参考 \u003Ca href=\"#for-linux--or-windows--users\">检查 CUDA 版本\u003C\u002Fa>），该 OP 由通用关键点检测框架 [X-Pose](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FX-Pose) 使用。\n\n```bash\ncd src\u002Futils\u002Fdependencies\u002FXPose\u002Fmodels\u002FUniPose\u002Fops\npython setup.py build install\ncd - # 等同于 cd ..\u002F..\u002F..\u002F..\u002F..\u002F..\u002F..\u002F\n```\n\n然后：\n```bash\npython inference_animals.py -s assets\u002Fexamples\u002Fsource\u002Fs39.jpg -d assets\u002Fexamples\u002Fdriving\u002Fwink.pkl --driving_multiplier 1.75 --no_flag_stitching\n```\n如果脚本成功运行，您将得到一个名为 `animations\u002Fs39--wink_concat.mp4` 的输出 MP4 文件。\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_f1952d55be87.gif\" alt=\"图片\">\n\u003C\u002Fp>\n\n#### 自动裁剪驱动视频 📢📢📢\n> [!重要提示]\n> 如果您想使用自己的驱动视频，我们 **建议**：⬇️\n> - 将其裁剪为 **1:1** 的宽高比例（例如 512x512 或 256x256 像素），或启用自动裁剪功能 `--flag_crop_driving_video`。\n> - 聚焦于头部区域，类似于示例视频。\n> - 尽量减少肩膀的移动。\n> - 确保驱动视频的第一帧是正面人脸，且表情 **中性**。\n\n以下是使用 `--flag_crop_driving_video` 进行自动裁剪的示例：\n```bash\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs9.jpg -d assets\u002Fexamples\u002Fdriving\u002Fd13.mp4 --flag_crop_driving_video\n```\n\n如果您发现自动裁剪的效果不够理想，可以调整 `--scale_crop_driving_video` 和 `--vy_ratio_crop_driving_video` 参数来改变裁剪的比例和偏移量，或者手动进行裁剪。\n\n#### 制作运动模板\n您还可以使用自动生成的以 `.pkl` 结尾的运动模板文件来加速推理，并 **保护隐私**，例如：\n```bash\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs9.jpg -d assets\u002Fexamples\u002Fdriving\u002Fd5.pkl # 人像动画\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs13.mp4 -d assets\u002Fexamples\u002Fdriving\u002Fd5.pkl # 人像视频编辑\n```\n\n### 4. Gradio 界面 🤗\n\n我们还提供了一个基于 Gradio \u003Ca href='https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fgradio-app\u002Fgradio'>\u003C\u002Fa> 的界面，以提升用户体验。只需运行以下命令即可启动：\n```bash\n# 对于 Linux 和 Windows 用户（以及搭载 Intel 的 macOS??）\npython app.py # humans 模式\n\n# 对于使用 Apple Silicon 的 macOS 用户，不支持 Intel 芯片，这可能会比 RTX 4090 慢 20 倍\nPYTORCH_ENABLE_MPS_FALLBACK=1 python app.py # 人类模式\n```\n\n我们还提供了动物模式的 Gradio 界面，该界面仅在配备 NVIDIA 显卡的 Linux 系统上进行了测试：\n```bash\npython app_animals.py # 动物模式 🐱🐶\n```\n\n您可以指定 `--server_port`、`--share` 和 `--server_name` 参数来满足您的需求！\n\n🚀 我们还提供了一个加速选项 `--flag_do_torch_compile`。首次推理会触发优化过程（大约一分钟），从而使后续推理速度提升 20% 到 30%。性能提升效果可能因不同的 CUDA 版本而异。\n```bash\n# 启用 torch.compile 以加快推理速度\npython app.py --flag_do_torch_compile\n```\n**注意**：此方法不适用于 Windows 和 macOS。\n\n**或者，您也可以在 [HuggingFace](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FKlingTeam\u002FLivePortrait) 上轻松体验 🤗**\n\n### 5. 推理速度评估 🚀🚀🚀\n我们还提供了一个脚本来评估每个模块的推理速度：\n\n```bash\n# 适用于 NVIDIA 显卡\npython speed.py\n```\n\n结果请见 [这里](.\u002Fassets\u002Fdocs\u002Fspeed.md)。\n\n## 社区资源 🤗\n\n探索由社区贡献的宝贵资源，以提升您的 LivePortrait 使用体验。\n\n\n### 社区开发的项目\n\n| 仓库 | 描述 | 作者 \u002F 链接 |\n|------|------|--------|\n| [**ditto-talkinghead**](https:\u002F\u002Fgithub.com\u002Fantgroup\u002Fditto-talkinghead) | 实时音频驱动的说话头。 | [ArXiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F2411.19509), [主页](https:\u002F\u002Fdigital-avatar.github.io\u002Fai\u002FDitto\u002F)  |\n| [**FasterLivePortrait**](https:\u002F\u002Fgithub.com\u002Fwarmshao\u002FFasterLivePortrait) | 使用 TensorRT 的更快实时版本。 | [@warmshao](https:\u002F\u002Fgithub.com\u002Fwarmshao) |\n| [**AdvancedLivePortrait-WebUI**](https:\u002F\u002Fgithub.com\u002Fjhj0517\u002FAdvancedLivePortrait-WebUI) | 基于 Gradio 的专用 WebUI，源自 [ComfyUI-AdvancedLivePortrait](https:\u002F\u002Fgithub.com\u002FPowerHouseMan\u002FComfyUI-AdvancedLivePortrait)。 | [@jhj0517](https:\u002F\u002Fgithub.com\u002Fjhj0517) |\n| [**FacePoke**](https:\u002F\u002Fgithub.com\u002Fjbilcke-hf\u002FFacePoke) | 一款实时头部变换应用，可通过鼠标控制！ | [@jbilcke-hf](https:\u002F\u002Fgithub.com\u002Fjbilcke-hf) |\n| [**FaceFusion**](https:\u002F\u002Fgithub.com\u002Ffacefusion\u002Ffacefusion) | FaceFusion 3.0 将 LivePortrait 集成为 `expression_restorer` 和 `face_editor` 处理器。 | [@henryruhs](https:\u002F\u002Fgithub.com\u002Fhenryruhs) |\n| [**sd-webui-live-portrait**](https:\u002F\u002Fgithub.com\u002Fdimitribarbot\u002Fsd-webui-live-portrait) | LivePortrait 的 WebUI 扩展，在原 Stable Diffusion WebUI 中添加标签页，以利用 LivePortrait 的功能。 | [@dimitribarbot](https:\u002F\u002Fgithub.com\u002Fdimitribarbot) |\n| [**ComfyUI-LivePortraitKJ**](https:\u002F\u002Fgithub.com\u002Fkijai\u002FComfyUI-LivePortraitKJ) | 一个用于使用 LivePortrait 的 ComfyUI 节点，使用 MediaPipe 替代 Insightface。 | [@kijai](https:\u002F\u002Fgithub.com\u002Fkijai) |\n| [**ComfyUI-AdvancedLivePortrait**](https:\u002F\u002Fgithub.com\u002FPowerHouseMan\u002FComfyUI-AdvancedLivePortrait) | 一个更快的 ComfyUI 节点，具有实时预览功能，启发了许多其他社区开发的工具和项目。 | [@PowerHouseMan](https:\u002F\u002Fgithub.com\u002FPowerHouseMan) |\n| [**comfyui-liveportrait**](https:\u002F\u002Fgithub.com\u002Fshadowcz007\u002Fcomfyui-liveportrait) | 一个用于使用 LivePortrait 的 ComfyUI 节点，支持多人脸、表情插值等功能，并配有[教程](https:\u002F\u002Fwww.bilibili.com\u002Fvideo\u002FBV1JW421R7sP)。 | [@shadowcz007](https:\u002F\u002Fgithub.com\u002Fshadowcz007) |\n\n### 试用平台、HuggingFace Spaces 及其他\n- [FacePoke Space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fjbilcke-hf\u002FFacePoke)\n- [Expression Editor Space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Ffffiloni\u002Fexpression-editor)\n- [Expression Editor Replicate](https:\u002F\u002Freplicate.com\u002Ffofr\u002Fexpression-editor)\n- [Face Control 实时演示](https:\u002F\u002Ffal.ai\u002Fdemos\u002Fface-control) 在 FAL 上\n- [Replicate Playground](https:\u002F\u002Freplicate.com\u002Ffofr\u002Flive-portrait)\n- Nuke 可以通过 CompyUI 节点使用 LivePortrait，详情请见 [这里](https:\u002F\u002Fx.com\u002Fbilawalsidhu\u002Fstatus\u002F1837349806475276338)\n- LivePortrait 也在 [Poe](https:\u002F\u002Fpoe.com\u002FLivePortrait) 上运行。\n\n### 视频教程\n- [LivePortrait 视频转视频工作流程](https:\u002F\u002Fyoutu.be\u002FxfzK_6cTs58?si=aYjgypeJBkhc46VL) 由 [@curiousrefuge](https:\u002F\u002Fwww.youtube.com\u002F@curiousrefuge) 制作\n- [Google Colab 教程](https:\u002F\u002Fyoutu.be\u002F59Y9ePAXTp0?si=KzEWhklBlporW7D8) 由 [@Planet Ai](https:\u002F\u002Fwww.youtube.com\u002F@planetai217) 制作\n- [论文解读](https:\u002F\u002Fyoutu.be\u002FfD0P6UWSu8I?si=Vn5wxUa8qSu1jv4l) 由 [@TwoMinutePapers](https:\u002F\u002Fwww.youtube.com\u002F@TwoMinutePapers) 制作\n- [ComfyUI Advanced LivePortrait](https:\u002F\u002Fyoutu.be\u002Fq0Vf-ZZsbzI?si=nbs3npleH-dVCt28) 由 [TutoView](https:\u002F\u002Fwww.youtube.com\u002F@TutoView) 制作\n- [LivePortarit 探索](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=vsvlbTEqgXQ) 和 [深入 LivePortrait](https:\u002F\u002Fyoutu.be\u002FcucaEEDYmsw?si=AtPaDWc5G-a4E8dD) 由 [TheoreticallyMedia](https:\u002F\u002Fwww.youtube.com\u002F@TheoreticallyMedia) 制作\n- [LivePortrait 实操教程](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=uyjSTAOY7yI) 由 [@AI Search](https:\u002F\u002Fwww.youtube.com\u002F@theAIsearch) 制作\n- [ComfyUI 教程](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=8-IcDDmiUMM) 由 [@Sebastian Kamph](https:\u002F\u002Fwww.youtube.com\u002F@sebastiankamph) 制作\n- [BiliBili 上的教程](https:\u002F\u002Fwww.bilibili.com\u002Fvideo\u002FBV1cf421i7Ly)\n\n此外，我们的社区还有许多令人惊叹的贡献，多到无法一一列举 💖\n\n## 致谢 💐\n我们衷心感谢 [FOMM](https:\u002F\u002Fgithub.com\u002FAliaksandrSiarohin\u002Ffirst-order-model)、[Open Facevid2vid](https:\u002F\u002Fgithub.com\u002Fzhanglonghao1992\u002FOne-Shot_Free-View_Neural_Talking_Head_Synthesis)、[SPADE](https:\u002F\u002Fgithub.com\u002FNVlabs\u002FSPADE)、[InsightFace](https:\u002F\u002Fgithub.com\u002Fdeepinsight\u002Finsightface) 和 [X-Pose](https:\u002F\u002Fgithub.com\u002FIDEA-Research\u002FX-Pose) 项目的贡献者们，感谢他们开放的研究成果和无私的贡献。\n\n## 伦理考量 🛡️\n肖像动画技术伴随着社会风险，尤其是可能被滥用于制作深度伪造内容。为降低这些风险，遵循伦理准则并采取负责任的使用方式至关重要。目前，合成结果中存在一些视觉伪影，有助于识别深度伪造。请注意，我们不对使用本项目生成的结果承担任何法律责任。\n\n## 引用 💖\n如果您发现 LivePortrait 对您的项目或研究有所帮助，请为本仓库点赞并使用以下 BibTeX 格式引用我们的工作：\n```bibtex\n@article{guo2024liveportrait,\n  title   = {LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control},\n  author  = {Guo, Jianzhu and Zhang, Dingyun and Liu, Xiaoqiang and Zhong, Zhizhou and Zhang, Yuan and Wan, Pengfei and Zhang, Di},\n  journal = {arXiv preprint arXiv:2407.03168},\n  year    = {2024}\n}\n```\n\n*愿它在 arXiv 上长存。*\n\n## 联系方式 📧\n[**郭建珠 (Jianzhu Guo)**](https:\u002F\u002Fguojianzhu.com); **guojianzhu1994@gmail.com**\n\n## 星星历史 🌟\n\u003Cdetails>\n  \u003Csummary>点击查看星星图表\u003C\u002Fsummary>\n  \u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fwww.star-history.com\u002F#KlingAIResearch\u002FLivePortrait&Timeline\" target=\"_blank\">\n      \u003Cpicture>\n        \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_61d17bf1b101.png&theme=dark\" \u002F>\n        \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_61d17bf1b101.png\" \u002F>\n        \u003Cimg alt=\"星星历史图表\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_readme_61d17bf1b101.png\" width=\"90%\" \u002F>\n      \u003C\u002Fpicture>\n    \u003C\u002Fa>\n  \u003C\u002Fp>\n\u003C\u002Fdetails>","# LivePortrait 快速上手指南\n\nLivePortrait 是一个高效的人像动画生成工具，支持通过驱动视频让人物或动物照片“动起来”，具备拼接（Stitching）和重定向（Retargeting）控制功能。\n\n## 1. 环境准备\n\n### 系统要求\n- **操作系统**: Linux, Windows, 或 macOS (Apple Silicon)\n- **Python**: 3.10\n- **GPU**: 推荐使用 NVIDIA GPU（Animals 模式必需）。macOS 仅支持 Humans 模式。\n- **前置依赖**:\n  - [`git`](https:\u002F\u002Fgit-scm.com\u002F)\n  - [`conda`](https:\u002F\u002Fanaconda.org\u002Fanaconda\u002Fconda)\n  - [`FFmpeg`](https:\u002F\u002Fffmpeg.org\u002Fdownload.html) (用于视频处理，[安装教程](assets\u002Fdocs\u002Fhow-to-install-ffmpeg.md))\n\n### 注意事项\n- **Windows 用户**: 若遇到高版本 CUDA (如 12.4+) 导致的未知问题，建议降级至 CUDA 11.8 以保证稳定性。\n- **Animals 模式**: 仅支持 Linux 和 Windows (NVIDIA GPU)，需要编译 `X-Pose` 依赖。macOS 不支持此模式。\n\n## 2. 安装步骤\n\n### 第一步：克隆代码并创建环境\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FKlingTeam\u002FLivePortrait\ncd LivePortrait\n\n# 创建 conda 环境\nconda create -n LivePortrait python=3.10\nconda activate LivePortrait\n```\n\n### 第二步：安装依赖库\n\n#### Linux \u002F Windows 用户\n如果需要运行 **Animals 模式**，请先检查并安装对应 CUDA 版本的 PyTorch（可选，仅当默认安装不兼容时）：\n```bash\nnvcc -V # 查看当前 CUDA 版本\n# 示例：CUDA 11.8\npip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n```\n\n安装核心依赖：\n```bash\npip install -r requirements.txt\n```\n\n> **Animals 模式额外步骤**：需编译 `MultiScaleDeformableAttention` 算子。\n> ```bash\n> cd src\u002Futils\u002Fdependencies\u002FXPose\u002Fmodels\u002FUniPose\u002Fops\n> python setup.py build install\n> cd -\n> ```\n\n#### macOS (Apple Silicon) 用户\nmacOS 不支持 Animals 模式，请使用专用依赖文件：\n```bash\npip install -r requirements_macOS.txt\n```\n\n### 第三步：下载预训练模型\n\n**推荐方式**：使用国内镜像源加速下载。\n```bash\n# 安装 huggingface_hub (如果未安装)\npip install -U \"huggingface_hub[cli]\"\n\n# 设置国内镜像地址\nexport HF_ENDPOINT=https:\u002F\u002Fhf-mirror.com\n\n# 下载模型到 pretrained_weights 目录\nhuggingface-cli download KlingTeam\u002FLivePortrait --local-dir pretrained_weights --exclude \"*.git*\" \"README.md\" \"docs\"\n```\n\n*备选方案*：若上述失败，可手动从 [百度网盘](https:\u002F\u002Fpan.baidu.com\u002Fs\u002F1MGctWmNla_vZxDbEp2Dtzw?pwd=z5cn) 下载，解压后放入 `.\u002Fpretrained_weights` 目录。\n\n## 3. 基本使用\n\n### 快速体验 (Humans 模式)\n运行默认示例，生成包含驱动视频、输入图和结果的视频文件 (`animations\u002Fs6--d0_concat.mp4`)。\n\n**Linux \u002F Windows:**\n```bash\npython inference.py\n```\n\n**macOS (Apple Silicon):**\n```bash\nPYTORCH_ENABLE_MPS_FALLBACK=1 python inference.py\n```\n\n### 自定义输入\n指定源图片\u002F视频 (`-s`) 和驱动视频 (`-d`)：\n\n```bash\n# 源输入为图片\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs9.jpg -d assets\u002Fexamples\u002Fdriving\u002Fd0.mp4\n\n# 源输入为视频\npython inference.py -s assets\u002Fexamples\u002Fsource\u002Fs13.mp4 -d assets\u002Fexamples\u002Fdriving\u002Fd0.mp4\n\n# 查看更多参数选项\npython inference.py -h\n```\n\n### 快速体验 (Animals 模式)\n*仅限 Linux\u002FWindows + NVIDIA GPU*\n\n```bash\npython inference_animals.py -s assets\u002Fexamples\u002Fsource\u002Fs39.jpg -d assets\u002Fexamples\u002Fdriving\u002Fwink.pkl --driving_multiplier 1.75 --no_flag_stitching\n```","某短视频内容创作者希望将一张已故亲人的静态老照片制作成动态视频，用于家族纪念仪式上的温情展示。\n\n### 没有 LivePortrait 时\n- 需要聘请专业特效师进行逐帧手绘或使用昂贵的商业软件，制作成本高达数千元且周期长达一周。\n- 传统驱动方法容易导致面部扭曲、五官错位，尤其是在头部转动时，背景与人物边缘会出现明显的撕裂感。\n- 难以精细控制表情幅度，往往出现笑容僵硬或眼神呆板的情况，无法还原亲人自然的神态。\n- 对非人类角色（如家中的宠物猫狗）完全无能为力，无法实现跨物种的肖像动画生成。\n\n### 使用 LivePortrait 后\n- 创作者只需在本地运行一键安装包，上传照片和一段驱动视频，几分钟内即可免费生成高质量动态效果。\n- 凭借独特的拼接（Stitching）技术，即使头部大幅转动，背景依然稳定清晰，人物边缘过渡自然无伪影。\n- 通过重定向（Retargeting）控制功能，可精准微调眉眼嘴角的运动幅度，让逝者重现温和自然的微笑。\n- 直接调用更新的动物模型，轻松让老照片中的宠物也“活”过来，摇头摆尾，极大丰富了纪念视频的情感维度。\n\nLivePortrait 将高门槛的专业肖像动画技术转化为普通人可用的创作工具，让静态记忆以极低成本焕发鲜活生命力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FKlingAIResearch_LivePortrait_546744c1.gif","KlingAIResearch","KlingAI Research","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FKlingAIResearch_ca409252.jpg","The Kling Team is building next-generation multimodal world models across video, audio, text, 3D, and beyond. Welcome to join us!",null,"klingteam@kuaishou.com","https:\u002F\u002Fgithub.com\u002FKlingAIResearch",[83,87,91],{"name":84,"color":85,"percentage":86},"Python","#3572A5",90.3,{"name":88,"color":89,"percentage":90},"Cuda","#3A4E3A",8.8,{"name":92,"color":93,"percentage":94},"C++","#f34b7d",0.9,18071,1876,"2026-04-08T02:17:22","NOASSERTION",4,"Linux, Windows, macOS (Apple Silicon)","人类模式：macOS Apple Silicon 可使用 MPS，Linux\u002FWindows 推荐 NVIDIA GPU；动物模式：必需 NVIDIA GPU。CUDA 版本推荐 11.8 或 12.1（Windows 高版本 CUDA 如 12.4+ 可能不稳定），未明确具体显存大小要求。","未说明",{"notes":104,"python":105,"dependencies":106},"1. 必须预先安装 git、conda 和 FFmpeg。2. 动物模式（猫\u002F狗）仅在 Linux 和 Windows 的 NVIDIA GPU 上支持，且需要手动编译 X-Pose 依赖中的 'MultiScaleDeformableAttention' 算子。3. macOS 用户仅支持人类模式，不支持动物模式，且在 Intel 芯片上未测试，M1\u002FM2 等芯片运行速度可能比 RTX 4090 慢约 20 倍。4. Windows 用户若遇到高版本 CUDA 问题，建议降级至 11.8。5. 提供一键安装包（Windows）和 HuggingFace 在线演示。","3.10",[107,108,109,110,111,112,113],"torch","torchvision","torchaudio","transformers","gradio","ffmpeg","X-Pose (仅动物模式，需编译)",[52,15],[116,117,118,119],"image-animation","video-editing","video-generation","face-animation","2026-03-27T02:49:30.150509","2026-04-08T17:47:45.538051",[123,128,133,138,143,148,153],{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},24849,"如何在 macOS Apple Silicon (M1\u002FM2) 上运行 LivePortrait？","LivePortrait 现已正式支持带有 Apple Silicon 的 macOS。您可以直接运行项目代码。此外，社区也提供了基于 ONNX 模型的优化方案，专门针对 M1 CPU 进行了加速，您可以参考相关仓库（如 Efficient-Live-Portrait）获取更快的推理速度。","https:\u002F\u002Fgithub.com\u002FKlingAIResearch\u002FLivePortrait\u002Fissues\u002F65",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},24850,"驱动视频的第一帧嘴巴张开会导致生成视频中嘴巴无法张开吗？如何解决？","是的，如果驱动视频的第一帧嘴巴是张开的，生成的视频中嘴唇可能会全程保持闭合状态。这是因为模型需要第一帧为“中性表情”（嘴巴闭合）。解决方法包括：1. 确保驱动视频的第一帧嘴巴是闭合的；2. 复制第一帧并使用重定向（re-targeting）功能将其调整为嘴巴闭合，然后将其移回视频序列的开头，生成后再移除该帧；3. 尝试使用参数 `--no-flag-relative-motion`，这可以使重定向更忠实于驱动视频的关键点。","https:\u002F\u002Fgithub.com\u002FKlingAIResearch\u002FLivePortrait\u002Fissues\u002F368",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},24851,"如何将模型转换为 ONNX 格式以解决 GridSample 5D 错误并加速推理？","在将 Warping 模型转换为 ONNX 时，常会遇到 `GridSample` 算子输入秩为 5 而非 4 的错误。社区成员已成功修复此问题并完成了 5 个原始模型的转换。您可以使用社区提供的 HuggingFace 模型（Live-Portrait-ONNX）和代码仓库（Efficient-Live-Portrait）直接运行。对于 Windows 用户，还有支持 TensorRT 的免安装包（FasterLivePortrait）可用，速度非常快。","https:\u002F\u002Fgithub.com\u002FKlingAIResearch\u002FLivePortrait\u002Fissues\u002F126",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},24852,"LivePortrait 支持动物（如猫、狗）的表情驱动吗？","支持。虽然默认代码主要针对人脸，但通过在动物数据上进行微调，可以实现对猫、狗甚至熊猫的精确驱动。社区确认猫和狗可以使用动物版的 LivePortrait 模型。如果您遇到“未检测到人脸”的错误，通常是因为需要使用专门针对动物训练或微调过的模型，或者调整检测器以适应动物特征。","https:\u002F\u002Fgithub.com\u002FKlingAIResearch\u002FLivePortrait\u002Fissues\u002F53",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},24853,"在安装依赖时遇到 onnxruntime-gpu 版本与 Python 版本不匹配的问题怎么办？","如果遇到 `onnxruntime-gpu` 要求 Python 版本 >=3.10 而您当前版本较低（如 3.9）的错误，建议升级您的 Python 环境至 3.10 或更高版本。另外，如果您使用的是 macOS Apple Silicon 或希望进行 CPU 推理，可以考虑使用社区提供的 ONNX 模型方案，它们对特定硬件有更好的兼容性。","https:\u002F\u002Fgithub.com\u002FKlingAIResearch\u002FLivePortrait\u002Fissues\u002F32",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},24854,"源图像和目标驱动视频表情不一致时（例如源图微笑露齿），如何获得更好的生成效果？","实验表明，如果源图像（Source）是微笑露齿的，而驱动视频（Driving）也有相似表情，结果会比较好。更重要的是，生成结果会尊重并保持源图像的牙齿结构。如果源图像是中性表情而驱动视频表情夸张，效果可能不如预期。建议在可能的情况下，选择与驱动视频表情相似的源图像，或者利用重定向功能调整源图像的初始状态。","https:\u002F\u002Fgithub.com\u002FKlingAIResearch\u002FLivePortrait\u002Fissues\u002F114",{"id":154,"question_zh":155,"answer_zh":156,"source_url":137},24855,"有没有针对 Windows 用户的便捷安装或加速方案？","有的。社区推出了名为 FasterLivePortrait 的项目，提供免安装、解压即用的 Windows 包，并且支持 TensorRT 加速。这比手动配置环境要方便得多，且推理速度显著提升。",[]]