当前位置: 首页 > article >正文

数字人技术之LatentSync Win11本地部署

#LatentSync技术原理

字节跳动开源的基于音频条件潜在扩散模型的端到端唇同步框架,基于潜在扩散模型,以音频条件潜在扩散模型为基础,利用 Stable Diffusion 强大能力,直接建模复杂的音频与视觉之间的关系,实现高质量的唇形同步. 从而制作虚拟主播与数字人等应用

#部署环境

win11 16G显存 (4060Ti)

git version 2.47.1.windows.2

conda 24.11.3

#前期准备

cuda环境

检查:

nvcc --version

nvidia-smi

#部署流程

下载项目源码:
git clone https://github.com/bytedance/LatentSync.git 

conda使用国内镜像:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

创建python环境:
conda create -n ltsenv python==3.10

进入隔离环境:

conda activate ltsenv

pyTorch官网:
     https://pytorch.org/

选择CUDA 12.4 :
    pip3 install torch torchvision torchaudio --index-url  https://download.pytorch.org/whl/cu124

注意 windows 环境下, python依赖 triton 2.2版本 无法使用

需要手动替换win支持的低版本 手动安装whl包 

安装视频库:

conda install -c conda-forge ffmpeg

####
windows :
Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps:

1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.3/frpc_windows_amd64.exe
2. Rename the downloaded file to: frpc_windows_amd64_v0.3
3. Move the file to this location: C:\DevTools\anaconda3\envs\ltsenv\lib\site-packages\gradio
####

以上步骤全部完成后 需要手动下载以下文件:  (因hugging face仓库国内访问受限)


https://hf-mirror.com/ByteDance/LatentSync/resolve/main/whisper/tiny.pt
https://hf-mirror.com/ByteDance/LatentSync/resolve/main/latentsync_syncnet.pt
https://hf-mirror.com/ByteDance/LatentSync/resolve/main/latentsync_unet.pt

或直接搜索国内镜像源 https://hf-mirror.com/ 镜像站 >搜索 LatentSync

完成后进入项目根目录 

创建checkpoints / whisper  2个文件夹

结构如下:

#####
./checkpoints/
|--latentsync_unet.pt
|--latentsync_syncnet.pt
|--whisper
      --thiy.pt
#####

####

找到根目录下的  requirements.txt文件, win环境下需要删除,liunx跳过

torch==2.2.2
torchvision==0.17.2
--extra-index-url https://download.pytorch.org/whl/cu121
xformers==0.0.26
triton==2.2.0

####

安装项目依赖

pip install requirements.txt   -i https://mirrors.aliyun.com/pypi/simple 

#启动项目

python gradio_app.py

启动之后通过 127.0.0.1:7860 进入操作界面 ,同时会给一个临时的外网URL访问.

####################至此部署完成####################

###################################################

#遇见问题

gradio.exceptions.Error: 'Error during processing: stabilityai/sd-vae-ft-mse does not appear to have a file named diffusion_pytorch_model.bin.'
 原因是国内访问不了huggingface 我们使用镜像源
解决方式:
在虚拟环境的 “../huggingface_hub”中找到:constants.py文件,将原来的默认网址修改为镜像网址
# _HF_DEFAULT_ENDPOINT = "https://huggingface.co"
_HF_DEFAULT_ENDPOINT = "https://hf-mirror.com"

亲测 16G显存 生成30秒视频 约5分钟左右. 可结合 文本转音频技术完成真人版数字人功能 


http://www.kler.cn/a/543310.html

相关文章:

  • 记忆增强检索能力的实践
  • 【IDEA】2017版本的使用
  • vue纯静态实现 视频转GIF 功能(附源码)
  • Mysql 函数解析
  • CNN-LSTM卷积神经网络长短期记忆神经网络多变量多步预测,光伏功率预测
  • 蓝桥杯算法日记|贪心、双指针
  • FPGA视频缩放转GTY光口传输,基于Aurora 8b/10b编解码架构,提供3套工程源码和技术支持
  • 数据结构 day02
  • 基于python sanic框架,使用Nacos进行微服务管理
  • elment-plus的表单的其中一项通过了验证再去走别的函数怎么写,不是全部内容通过验证
  • 银河麒麟kylin V10安装docker时出现的问题
  • 大数据学习之SparkStreaming、PB级百战出行网约车项目一
  • 数据可视化:让数据讲故事的力量
  • AI前端开发社区与资源:效率提升的秘密武器
  • 『哈哥赠书 - 55期』-『码农职场:IT人求职就业手册』
  • 使用 EMQX 接入 LwM2M 协议设备
  • GlusterFS 深度洞察:从架构原理到案例实践的全面解读(上)
  • Java(Springboot)
  • 使用Python爬虫获取淘宝搜索词推荐API接口
  • 人工智能加速冲击?Anthropic报告:43%的任务正被人工智能替代
  • 零基础学CocosCreator·第九季-网络游戏同步策略与ESC架构
  • Windows逆向工程入门之标志寄存器及其结构和标志位
  • Ollama本地部署DeepSeek(Mac)
  • 网络安全纵深防御体系框架 网络安全防护体系
  • 【2025新】基于springboot的问卷调查小程序设计与实现
  • 【亲测可用】Bandicam v8.1.0(班迪录屏软件)便携完整版