From 7e0cddec8f9f41a33a6055380ba1b0a83b86f927 Mon Sep 17 00:00:00 2001
From: hit-cxf <2024111082@stu.hit.edu.cn>
Date: Sat, 30 May 2026 21:25:38 +0800
Subject: [PATCH] Optimized VLM Judge-Refine Cycle

---
 video-claw/video-claw/backend/models/video_client.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/video-claw/video-claw/backend/models/video_client.py b/video-claw/video-claw/backend/models/video_client.py
index f9ac1ba..d9f6559 100644
--- a/video-claw/video-claw/backend/models/video_client.py
+++ b/video-claw/video-claw/backend/models/video_client.py
@@ -161,6 +161,8 @@
                 model,
                 duration,
                 sound,
+                video_ratio,
+                resolution,
                 mode,
                 cfg_scale,
                 negative_prompt or "",
@@ -203,6 +205,11 @@
             )
         else:
             raise ValueError(f"未知的视频生成模型: {model}")
+
+    @staticmethod
+    def _normalize_seedance_resolution(resolution: Optional[str]) -> str:
+        value = (resolution or "720p").strip().lower()
+        return value if value in {"720p", "1080p"} else "720p"
 
     def _generate_wan(
         self,
@@ -263,6 +270,8 @@
         model: str,
         duration: int = 5,
         sound: str = "",
+        video_ratio: str = "16:9",
+        resolution: Optional[str] = None,
         mode: str = "pro",
         cfg_scale: float = 0.5,
         negative_prompt: str = "",
@@ -276,6 +285,8 @@
             model=model,
             duration=duration,
             sound=sound,
+            video_ratio=video_ratio,
+            resolution=resolution,
             mode=mode,
             cfg_scale=cfg_scale,
             negative_prompt=negative_prompt,
@@ -303,7 +314,7 @@
             model=model,
             duration=duration,
             ratio=video_ratio,
-            resolution=resolution or "720p",
+            resolution=self._normalize_seedance_resolution(resolution),
             seed=seed,
             watermark=watermark,
             generate_audio=generate_audio,

--
Gitblit v1.8.0