fix(canvas): 视频设置 - 按渠道能力隐藏尺寸并联动分辨率宽高
This commit is contained in:
1 parent
6d77c250c1
commit
4b75504f75
15 files changed
+196
-50
No files matched your search
@@ -237,6 +237,25 @@ func TestNormalizeVideoCapabilityAllowsOmittedResolution(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeVideoCapabilityAllowsOmittedRatio(t *testing.T) {
|
||||
profile := DefaultModelCapabilityConfigForModel("autodl-comfyui", "minimax_h3_lightx2v_no_pic").Video
|
||||
profile.Ratios = nil
|
||||
profile.DefaultRatio = ""
|
||||
profile.Resolutions = []string{"480p竖", "480p横"}
|
||||
profile.DefaultResolution = "480p竖"
|
||||
|
||||
result, err := NormalizeModelCapabilityConfig("video", "autodl-comfyui", &ModelCapabilityConfig{Version: 1, Video: profile})
|
||||
if err != nil {
|
||||
t.Fatalf("NormalizeModelCapabilityConfig() error = %v", err)
|
||||
}
|
||||
if result.Video == nil || len(result.Video.Ratios) != 0 || result.Video.DefaultRatio != "" {
|
||||
t.Fatalf("normalized video ratios = %#v", result.Video)
|
||||
}
|
||||
if err := validateVideoTask(result.Video, canvasGenerationInput{Config: providerConfig{Model: "minimax_h3_lightx2v_no_pic", VideoSeconds: "6", VQuality: "480p竖"}}); err != nil {
|
||||
t.Fatalf("validateVideoTask() error = %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCapabilitySpecFromModelCapabilityConfigProjectsImageSizeOnce(t *testing.T) {
|
||||
config := &ModelCapabilityConfig{
|
||||
Version: 1,
|
||||
|
||||
Reference in new issue
Block a user