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:
@@ -2475,11 +2475,12 @@ func upstreamVideoSize(aspectRatio, resolution string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// vividQuality maps a resolution tier to the quality string a Vivid-protocol
|
// 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 {
|
func vividQuality(resolution string) string {
|
||||||
switch strings.ToUpper(strings.TrimSpace(resolution)) {
|
if q := strings.TrimSpace(resolution); q != "" {
|
||||||
case "2K", "4K":
|
return q
|
||||||
return strings.ToUpper(strings.TrimSpace(resolution))
|
|
||||||
}
|
}
|
||||||
return "1K"
|
return "1K"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user