From ff2ff863a2a164be056e3f559638647c2818b3e5 Mon Sep 17 00:00:00 2001 From: saas-backend Date: Tue, 22 Sep 2026 23:51:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(gpu):=20=E4=BF=AE=E5=A4=8DMuseTalk=E8=93=9D?= =?UTF-8?q?=E8=89=B2=E5=9D=97=20=E2=80=94=20Step5=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=A4=9A=E4=BD=99BGR2RGB=E8=BD=AC=E6=8D=A2=EF=BC=8C=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E4=BC=A0BGR=E7=BB=99VAE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VAE内部preprocess_img已做BGR→RGB,外层再cvtColor导致双重转换、R/B通道互换(蓝脸根因)。 该修复此前由运维直接改在GPU机器上验证有效,现补提PR入develop。 GFPGAN链路色彩空间核对:修复后主管线为BGR约定(encode BGR、decode输出按BGR融合), GFPGAN段BGR→RGB输入/return_rgb=True后RGB→BGR回写,通道一致,无需改动; 当前MUSE_USE_GFPGAN=0禁用,待基础功能确认后开启做运行时验证。 --- deploy/gpu_worker/musetalk_server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy/gpu_worker/musetalk_server.py b/deploy/gpu_worker/musetalk_server.py index fa1aa080e..4c1493b21 100644 --- a/deploy/gpu_worker/musetalk_server.py +++ b/deploy/gpu_worker/musetalk_server.py @@ -805,8 +805,9 @@ def _run_inference( crop = frame[y1:y2_eff, x1:x2] if crop.size == 0: continue - crop_rgb = cv2.cvtColor(crop, cv2.COLOR_BGR2RGB) - crop_resized = cv2.resize(crop_rgb, (256, 256), interpolation=cv2.INTER_LANCZOS4) + # 直接传 BGR 给 VAE:VAE 内部 preprocess_img 已做 BGR→RGB 转换, + # 此处再 cvtColor 会造成双重转换、R/B 通道互换(蓝色块根因)。 + crop_resized = cv2.resize(crop, (256, 256), interpolation=cv2.INTER_LANCZOS4) # 使用 VAE 的 get_latents_for_unet 得到 8 通道输入 # get_latents_for_unet 内部: preprocess(half_mask=True) encode + preprocess(half_mask=False) encode → cat → [1,8,32,32] latents = vae.get_latents_for_unet(crop_resized).detach().cpu() -- 2.54.0