fix(upstream): vivid 协议的 quality 原样透传分辨率档位

vivid 的 quality 就是模型自己的档位字符串——图像 1K/2K/4K、视频
720p/1080p。之前映射成 OpenAI 的 low/medium/high 导致视频上游收到
"1K" 报 4001 "该模型支持 720p"。现在原样透传,空值才默认 1K。

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
2026-10-14 16:59:13 +08:00
co-authored by Devin
parent 1fee3e5461
commit e7a4613bac
+5 -4
View File
@@ -2475,11 +2475,12 @@ func upstreamVideoSize(aspectRatio, resolution string) string {
}
// vividQuality maps a resolution tier to the quality string a Vivid-protocol
// upstream expects ("1K"/"2K"/"4K"); empty → "1K" (required field).
// upstream expects. Vivid passes the tier through verbatim — "1K"/"2K"/"4K"
// for images, "720p"/"1080p"/"540p" for videos — so don't re-map to the OpenAI
// enum; only default a blank to "1K" (the field is required).
func vividQuality(resolution string) string {
switch strings.ToUpper(strings.TrimSpace(resolution)) {
case "2K", "4K":
return strings.ToUpper(strings.TrimSpace(resolution))
if q := strings.TrimSpace(resolution); q != "" {
return q
}
return "1K"
}