无言以对 发表于 2025-3-19 09:12:47

LatentSync V6版 - 新增批量处理,优化修复,音频驱动视频生成数字人说话视频 本地一键整合包下载


LatentSync‌ 是由字节跳动与北京交通大学联合提出的一种基于音频条件的潜在扩散模型的端到端唇同步框架。该框架无需任何中间运动表示,直接利用Stable Diffusion的强大能力,建模复杂的音频与视觉之间的关系,实现视频中人物唇部动作与音频的精准同步‌。
LatentSync‌ 是基于音频条件的端到端唇形同步框架,其核心目标是通过音频输入生成高分辨率、动态逼真的唇形同步视频,解决传统方法中时间一致性差、硬件要求高等问题。可广泛用于音频驱动数字人项目中,测试下来,应该是目前开源综合效果最好的数字人项目。

今天分享的 LatentSync V6版,基于官方最新的 LatentSync1.5版,新版主要更新以下内容:
1、新增批量处理,可以同时处理多个任务;
2、同步官方源代码,修复上个版本视频长度大于音频长度导致生成视频结尾被切断的bug。


应用场景‌ ‌
影视与广告制作‌:用于后期配音同步、虚拟角色口型调整,提升视频真实感‌。 ‌
教育与企业服务‌:生成虚拟教师或客服的唇形同步视频,增强教学与服务的互动性‌。 ‌
游戏与虚拟人开发‌:为游戏角色或数字人赋予动态口型,实现实时语音交互‌。 ‌
直播与短视频创作‌:支持虚拟主播口型实时匹配音频,降低多语言内容制作成本‌。


使用教程:(建议N卡,显存6G起。基于CUDA12.1)
上传驱动音频和视频,设置相关参数,生成即可。
注意事项:上传参考音频和视频时间长度最好一致,如果音频长度大于视频长度,则默认按照视频时长长度生成。如果视频长度大于音频长度,默认按照音频时长长度生成。
视频教程:https://www.toutiao.com/video/7483695386323878434/

下载地址:
迅雷云盘:https://pan.xunlei.com/s/VOLhNcJyxXP2Yw0QoHdmMr6xA1?pwd=2kjp
夸克网盘:**** 本内容需购买 ****
百度网盘:
**** 本内容需购买 ****

解压密码:https://deepface.cc/ 复制这个完整的网址即是解压密码,不要有空格,复制粘贴即可

yangliu 发表于 2025-3-19 15:50:02


生成错误,帮忙看下是哪里出问题。


无言以对 发表于 2025-3-19 15:53:31

yangliu 发表于 2025-3-19 15:50
生成错误,帮忙看下是哪里出问题。
手动设置虚拟内存,设置方法参考 此贴

下次请复制黑色窗口完整信息,不要截图,这样能查看到的信息更完整,方便找问题。

yangliu 发表于 2025-3-19 16:12:16

E:\LatentSync-V6\deepface\lib\site-packages\_distutils_hack\__init__.py:15: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
E:\LatentSync-V6\deepface\lib\site-packages\_distutils_hack\__init__.py:30: UserWarning: Setuptools is replacing distutils. Support for replacing an already imported distutils is deprecated. In the future, this condition will fail. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
warnings.warn(
* 在本地URL上运行L:http://127.0.0.1:7860
* 整合包制作:https://deepface.cc

To create a public link, set `share=True` in `launch()`.
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "E:\LatentSync-V6\deepface\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
File "E:\LatentSync-V6\deepface\lib\asyncio\proactor_events.py", line 165, in _call_connection_lost
    self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: 远程主机强迫关闭了一个现有的连接。
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "E:\LatentSync-V6\deepface\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
File "E:\LatentSync-V6\deepface\lib\asyncio\proactor_events.py", line 165, in _call_connection_lost
    self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: 远程主机强迫关闭了一个现有的连接。
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "E:\LatentSync-V6\deepface\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
File "E:\LatentSync-V6\deepface\lib\asyncio\proactor_events.py", line 165, in _call_connection_lost
    self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: 远程主机强迫关闭了一个现有的连接。
Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
File "E:\LatentSync-V6\deepface\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
File "E:\LatentSync-V6\deepface\lib\asyncio\proactor_events.py", line 165, in _call_connection_lost
    self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: 远程主机强迫关闭了一个现有的连接。
视频输入路径: C:/Users/34642/AppData/Local/Temp/gradio/245e94ef00eb36da793ef183fcf94d7f65b386b068618fbbfd90a3c96f09591c/shipin-chuanqi.MP4
音频输入路径: C:/Users/34642/AppData/Local/Temp/gradio/03ba8d1bd292df72ece9fbfdb17c128db613c20d35c3f74358ea7bfd3965e733/yinpin 22.WAV
从以下路径加载模型: E:/LatentSync-V6/checkpoints/latentsync_unet.pt
初始化种子: 1247
视频帧率为 25 FPS, 音频idx帧率 50FPS
处理过程中出错: Unable to allocate 76.9 GiB for an array with shape (3318, 2160, 3840, 3) and data type uint8
Traceback (most recent call last):
File "<frozen app>", line 77, in process_video
File "E:\LatentSync-V6\scripts\inference.py", line 82, in main
    pipeline(
File "E:\LatentSync-V6\deepface\lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
File "E:\LatentSync-V6\latentsync\pipelines\lipsync_pipeline.py", line 373, in __call__
    video_frames = read_video(video_path, use_decord=False)
File "E:\LatentSync-V6\latentsync\utils\util.py", line 62, in read_video
    return read_video_cv2(target_video_path)
File "E:\LatentSync-V6\latentsync\utils\util.py", line 99, in read_video_cv2
    return np.array(frames)
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 76.9 GiB for an array with shape (3318, 2160, 3840, 3) and data type uint8

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\LatentSync-V6\deepface\lib\site-packages\gradio\queueing.py", line 625, in process_events
    response = await route_utils.call_process_api(
File "E:\LatentSync-V6\deepface\lib\site-packages\gradio\route_utils.py", line 322, in call_process_api
    output = await app.get_blocks().process_api(
File "E:\LatentSync-V6\deepface\lib\site-packages\gradio\blocks.py", line 2042, in process_api
    result = await self.call_function(
File "E:\LatentSync-V6\deepface\lib\site-packages\gradio\blocks.py", line 1589, in call_function
    prediction = await anyio.to_thread.run_sync(# type: ignore
File "E:\LatentSync-V6\deepface\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
File "E:\LatentSync-V6\deepface\lib\site-packages\anyio\_backends\_asyncio.py", line 2461, in run_sync_in_worker_thread
    return await future
File "E:\LatentSync-V6\deepface\lib\site-packages\anyio\_backends\_asyncio.py", line 962, in run
    result = context.run(func, *args)
File "E:\LatentSync-V6\deepface\lib\site-packages\gradio\utils.py", line 883, in wrapper
    response = f(*args, **kwargs)
File "<frozen app>", line 96, in process_video
gradio.exceptions.Error: '处理过程中出错: Unable to allocate 76.9 GiB for an array with shape (3318, 2160, 3840, 3) and data type uint8'



虚拟内存设置之后还是报错,上面是复制的黑色窗口完整信息,辛苦再看下。

无言以对 发表于 2025-3-19 16:12:47

yangliu 发表于 2025-3-19 16:12
E:\LatentSync-V6\deepface\lib\site-packages\_distutils_hack\__init__.py:15: UserWarning: Distutils w ...
报错就是虚拟内存 不足,你多半是设置不对
虚拟内存设置截图,或者认真对照教程检查

AI001 发表于 2025-3-19 17:13:10

2060S,16G内存能不能玩?低版本可以用,这个1.5可不可以?

无言以对 发表于 2025-3-19 17:15:24

AI001 发表于 2025-3-19 17:13
2060S,16G内存能不能玩?低版本可以用,这个1.5可不可以?

你试试,我没20系卡,没测过

AI001 发表于 2025-3-19 19:40:30

无言以对 发表于 2025-3-19 17:15
你试试,我没20系卡,没测过

跑到这里,就不动了,等了40分钟

进行推理...:   0%|                                                                                                            | 0/17 D
                                                                                                                     D:\AItool\LatentSync-V6\deepface\lib\site-packages\diffusers\models\attention_processor.py:3286: UserWarning: 1Torch was not compiled with flash attent
                                                                                                                     tion. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555
                                                                                                                     5.)
hidden_states = F.scaled_dot_product_attention(

样本帧: 16:   0%|                                                                                                             | 0/20
样本帧: 16:   5%|█████                                                                                                | 1/20
样本帧: 16:10%|██████████                                                                                           | 2/20
样本帧: 16:15%|███████████████▏                                                                                     | 3/20
样本帧: 16:20%|████████████████████▏                                                                              | 4/20
样本帧: 16:25%|█████████████████████████▎                                                                           | 5/20
样本帧: 16:30%|██████████████████████████████▎                                                                      | 6/20
样本帧: 16:35%|███████████████████████████████████▎                                                               | 7/20
样本帧: 16:40%|████████████████████████████████████████▍                                                            | 8/20
样本帧: 16:45%|█████████████████████████████████████████████▍                                                       | 9/20
样本帧: 16:50%|██████████████████████████████████████████████████                                                | 10/20
样本帧: 16:55%|███████████████████████████████████████████████████████                                             | 11/20
样本帧: 16:60%|████████████████████████████████████████████████████████████                                        | 12/20
样本帧: 16:65%|█████████████████████████████████████████████████████████████████                                 | 13/20
样本帧: 16:70%|██████████████████████████████████████████████████████████████████████                              | 14/20
样本帧: 16:75%|███████████████████████████████████████████████████████████████████████████                         | 15/20
样本帧: 16:80%|████████████████████████████████████████████████████████████████████████████████                  | 16/20
样本帧: 16:85%|█████████████████████████████████████████████████████████████████████████████████████               | 17/20
样本帧: 16:90%|██████████████████████████████████████████████████████████████████████████████████████████          | 18/20
样本帧: 16:95%|███████████████████████████████████████████████████████████████████████████████████████████████   | 19/20
样本帧: 16: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20
样本帧: 16: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20

无言以对 发表于 2025-3-19 20:02:09

AI001 发表于 2025-3-19 19:40
跑到这里,就不动了,等了40分钟

进行推理...:   0%|                                                 ...

我测试了30和40系卡,都没问题。
如果用不了,你就用以前的版本。毕竟2060已经跟不上技术发展了。

rongma1sheng 发表于 2025-3-21 17:21:03

夸克压缩包显示错误,能不能修改下
页: [1] 2 3 4
查看完整版本: LatentSync V6版 - 新增批量处理,优化修复,音频驱动视频生成数字人说话视频 本地一键整合包下载