From b0ce033002d3f9dd2dea41cf06b334e4b51b91e6 Mon Sep 17 00:00:00 2001 From: Hawk Lee Date: Sat, 24 Jan 2026 20:07:04 +0800 Subject: [PATCH] v1.9.161: Absolute Neutral Anchor - Cancel photo tilt from Frame 0 to fix initial 8s baring --- .../Ditto/core/atomic_components/audio2motion.py | 16 ++++++++++++---- pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libs/Ditto/core/atomic_components/audio2motion.py b/libs/Ditto/core/atomic_components/audio2motion.py index f93cfcf..5a2af0c 100644 --- a/libs/Ditto/core/atomic_components/audio2motion.py +++ b/libs/Ditto/core/atomic_components/audio2motion.py @@ -125,6 +125,13 @@ class Audio2Motion: p_s = e_s / e_s.sum() self.s_pitch_deg = np.sum(p_s * np.arange(66)) * 3 - 97.5 print(f"[Postural Setup] Source Pitch Base: {self.s_pitch_deg:.2f}°") + + # [v1.9.161] Absolute Neutral Baseline (Zero-Drift Goal) + # We store an offset that cancelling out the source photo's postural bias. + # This allows us to anchor to a TRUE "Flat View" (0,0,0) from frame 0. + self.posture_neutralizer = np.zeros_like(self.s_kp_cond) + # Index 1:202 contains Scale(1), Pitch(66), Yaw(66), Roll(66), T(3) + self.posture_neutralizer[0, 1:202] = -self.s_kp_cond[0, 1:202] def _fuse(self, res_kp_seq, pred_kp_seq, override_alpha=None, step_len=None): ## ======================== @@ -333,14 +340,15 @@ class Audio2Motion: # [v1.9.160] STATIC POSTURE MODE # Based on validation, we now enforce high Pitch pressure ALWAYS to prevent drift. - # This eliminates the dependency on 'Hysteresis Recovery' and ensures the jaw stays stable. + # [v1.9.161] Neutral Baseline: Anchor is shifted to TRUE 0 (Neutral Center). if True: - # [v1.9.160] Constant 95% tension for Pitch (Vertical) + # Constant 95% tension for Pitch (Vertical) pressure = 0.95 soft_p = 0.40 # Maintain soft-lock for Yaw/Roll to allow mouth projection - # Anchor is source + current Brownian offset - anchor_p = self.s_kp_cond[0, 1:202] + self.brownian_pos[0, 1:202] + # [v1.9.161] Anchor = Neutralized Source (0-Posture) + Brownian micro-drift + # This ensures we anchor to FLAT view, even if the photo is tilted. + anchor_p = (self.s_kp_cond + self.posture_neutralizer + self.brownian_pos)[0, 1:202] for f in range(pred_kp_seq.shape[1]): # Absolute Pitch Locking (Halt baring distortion) diff --git a/pyproject.toml b/pyproject.toml index 29f4332..09406c3 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "aiia" description = "The Ultimate AI Audio/Video toolkit for ComfyUI. Features an enhanced Ditto (with optimizations that outperform official demos and other SOTA talking head models in lip-sync accuracy and natural motion), EchoMimic V3 & FLOAT, VibeVoice & CosyVoice 3.0 (Zero-Shot Voice Cloning), Multi-Role Podcast Generation, and a powerful Media Browser." -version = "1.9.160" +version = "1.9.161" license = {file = "LICENSE"} readme = "README.md" authors = [