若干更新迭代
This commit is contained in:
1 parent
deb9cc5bcf
commit
4ac786aafb
64 files changed
+3251
-291
No files matched your search
@@ -236,6 +236,11 @@ func providerVideoModels(getenv postgres.Getenv) map[string]jobs.ProviderTarget
|
||||
for _, model := range models {
|
||||
targets[model] = jobs.ProviderTarget{Provider: "seedance", Model: model, Settings: seedanceDefaultSettings(getenv, model)}
|
||||
}
|
||||
bailianConfigured := firstNonEmpty(getenv("BAILIAN_VIDEO_MODEL"), "wan2.7-i2v-2026-04-25")
|
||||
for _, model := range []string{"wan2.7-i2v-2026-04-25", "wan3.0-video", bailianConfigured} {
|
||||
targets[model] = jobs.ProviderTarget{Provider: "bailian", Model: model}
|
||||
}
|
||||
targets[providers.MinimaxH3Model] = jobs.ProviderTarget{Provider: "minimax", Model: providers.MinimaxH3Model, Settings: map[string]any{"ratio": "16:9", "duration": float64(5), "resolution": "768P"}}
|
||||
return targets
|
||||
}
|
||||
|
||||
@@ -303,7 +308,8 @@ func capabilitySummary(getenv postgres.Getenv) func(context.Context) (any, error
|
||||
primaryVideo["limits"] = minimaxVideoCapabilityLimits()
|
||||
} else {
|
||||
primaryVideo["label"] = "百炼图生视频"
|
||||
primaryVideo["limits"] = bailianVideoCapabilityLimits()
|
||||
primaryVideo["limits"] = bailianVideoCapabilityLimitsForModel(videoModel(getenv))
|
||||
primaryVideo["models"] = bailianVideoModelOptions()
|
||||
}
|
||||
imageCapability := map[string]any{"id": "image.generate", "label": imageCapabilityLabel(engine), "kind": "image", "engine": engine, "provider": provider, "reqKey": imageModel(getenv)}
|
||||
imageCapability["evolink"] = evolinkImageCapability(getenv)
|
||||
@@ -313,7 +319,7 @@ func capabilitySummary(getenv postgres.Getenv) func(context.Context) (any, error
|
||||
return []any{
|
||||
imageCapability,
|
||||
primaryVideo,
|
||||
map[string]any{"id": "video.generate.bailian", "label": "百炼图生视频", "kind": "video", "engine": "bailian", "provider": "bailian", "reqKey": firstNonEmpty(getenv("BAILIAN_VIDEO_MODEL"), "wan2.7-i2v-2026-04-25"), "limits": bailianVideoCapabilityLimits()},
|
||||
map[string]any{"id": "video.generate.bailian", "label": "百炼图生视频", "kind": "video", "engine": "bailian", "provider": "bailian", "reqKey": firstNonEmpty(getenv("BAILIAN_VIDEO_MODEL"), "wan2.7-i2v-2026-04-25"), "limits": bailianVideoCapabilityLimitsForModel(firstNonEmpty(getenv("BAILIAN_VIDEO_MODEL"), "wan2.7-i2v-2026-04-25")), "models": bailianVideoModelOptions()},
|
||||
map[string]any{"id": "video.generate.minimax", "label": "MiniMax H3 视频生成", "kind": "video", "engine": "minimax", "provider": "minimax", "reqKey": providers.MinimaxH3Model, "limits": minimaxVideoCapabilityLimits()},
|
||||
}, nil
|
||||
}
|
||||
@@ -344,7 +350,13 @@ func seedanceCapabilityLimits(model string) map[string]any {
|
||||
if model == "doubao-seedance-2-5-260628" {
|
||||
maximum = 30
|
||||
}
|
||||
return map[string]any{"durationSeconds": map[string]int{"min": 4, "max": maximum}, "ratios": []string{"16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "adaptive"}, "resolutions": []string{"480p", "720p", "1080p"}}
|
||||
limits := map[string]any{"durationSeconds": map[string]int{"min": 4, "max": maximum}, "ratios": []string{"16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "adaptive"}, "resolutions": []string{"480p", "720p", "1080p"}}
|
||||
if model == "doubao-seedance-2-5-260628" {
|
||||
limits["materials"] = map[string]int{"images": 30, "videos": 10, "audios": 10, "total": 50}
|
||||
} else {
|
||||
limits["materials"] = map[string]int{"images": 9, "videos": 3, "audios": 3}
|
||||
}
|
||||
return limits
|
||||
}
|
||||
|
||||
func seedanceModelOptions() []any {
|
||||
@@ -358,9 +370,30 @@ func bailianVideoCapabilityLimits() map[string]any {
|
||||
return map[string]any{"inputImages": map[string]int{"min": 1, "max": 2}, "durationSeconds": map[string]int{"min": 2, "max": 15}, "resolutions": []string{"720P", "1080P"}}
|
||||
}
|
||||
|
||||
func bailianVideoCapabilityLimitsForModel(model string) map[string]any {
|
||||
if model != "wan3.0-video" {
|
||||
return bailianVideoCapabilityLimits()
|
||||
}
|
||||
return map[string]any{
|
||||
"inputImages": map[string]int{"min": 0, "max": 10},
|
||||
"inputModes": map[string]any{"reference": map[string]int{"min": 0, "max": 10}, "frames": map[string]int{"min": 1, "max": 2}},
|
||||
"durationSeconds": map[string]int{"min": 2, "max": 30},
|
||||
"resolutions": []string{"480P", "720P", "1080P"},
|
||||
"ratios": []string{"adaptive", "21:9", "16:9", "4:3", "1:1", "3:4", "9:16"},
|
||||
}
|
||||
}
|
||||
|
||||
func bailianVideoModelOptions() []any {
|
||||
return []any{
|
||||
map[string]any{"id": "wan2.7-i2v-2026-04-25", "label": "Wan 2.7 首尾帧", "limits": bailianVideoCapabilityLimits()},
|
||||
map[string]any{"id": "wan3.0-video", "label": "Wan 3.0 多图参考", "limits": bailianVideoCapabilityLimitsForModel("wan3.0-video")},
|
||||
}
|
||||
}
|
||||
|
||||
func minimaxVideoCapabilityLimits() map[string]any {
|
||||
return map[string]any{
|
||||
"inputImages": map[string]int{"min": 0, "max": 1},
|
||||
"inputImages": map[string]int{"min": 0, "max": 9},
|
||||
"inputModes": map[string]any{"reference": map[string]int{"min": 0, "max": 9}, "frames": map[string]int{"min": 0, "max": 1}},
|
||||
"durationSeconds": map[string]int{"min": 4, "max": 15},
|
||||
"ratios": []string{"21:9", "16:9", "4:3", "1:1", "3:4", "9:16", "adaptive"},
|
||||
"resolutions": []string{"768P", "2K"},
|
||||
@@ -390,6 +423,8 @@ func runtimeHealthDetails(getenv postgres.Getenv) httpapi.HealthDetails {
|
||||
}
|
||||
if video == "seedance" {
|
||||
videoCapability["models"] = seedanceModelOptions()
|
||||
} else if video == "bailian" {
|
||||
videoCapability["models"] = bailianVideoModelOptions()
|
||||
}
|
||||
return httpapi.HealthDetails{
|
||||
VisualAPIMode: providerMode(visualConfigured, "volcengine"),
|
||||
|
||||
@@ -432,6 +432,38 @@ func TestProviderVideoModelsKeepSeedance20And25Available(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestProviderVideoModelsIncludeWan30AndScopedReferenceLimits(t *testing.T) {
|
||||
targets := providerVideoModels(func(string) string { return "" })
|
||||
if target := targets["wan3.0-video"]; target.Provider != "bailian" || target.Model != "wan3.0-video" {
|
||||
t.Fatalf("Wan 3.0 target=%#v", target)
|
||||
}
|
||||
if target := targets[providers.MinimaxH3Model]; target.Provider != "minimax" {
|
||||
t.Fatalf("MiniMax target=%#v", target)
|
||||
}
|
||||
if got := bailianVideoCapabilityLimitsForModel("wan3.0-video")["inputImages"].(map[string]int)["max"]; got != 10 {
|
||||
t.Fatalf("Wan 3.0 max images=%d", got)
|
||||
}
|
||||
if got := minimaxVideoCapabilityLimits()["inputImages"].(map[string]int)["max"]; got != 9 {
|
||||
t.Fatalf("MiniMax max images=%d", got)
|
||||
}
|
||||
if got := seedanceCapabilityLimits("doubao-seedance-2-0-260128")["materials"].(map[string]int)["images"]; got != 9 {
|
||||
t.Fatalf("Seedance 2.0 max images=%d", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBailianCapabilityLimitsUseItsConfiguredModelWhenAnotherEngineIsDefault(t *testing.T) {
|
||||
values := map[string]string{"VIDEO_GENERATE_ENGINE": "seedance", "BAILIAN_VIDEO_MODEL": "wan3.0-video"}
|
||||
capabilities, err := capabilitySummary(func(name string) string { return values[name] })(context.Background())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
bailian := capabilities.([]any)[2].(map[string]any)
|
||||
limits := bailian["limits"].(map[string]any)
|
||||
if bailian["reqKey"] != "wan3.0-video" || limits["inputImages"].(map[string]int)["max"] != 10 || limits["durationSeconds"].(map[string]int)["max"] != 30 {
|
||||
t.Fatalf("Bailian capability=%#v", bailian)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCapabilitySummaryMatchesConfiguredDefaultVideoEngine(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
name, engine, wantEngine, wantProvider, wantModel string
|
||||
|
||||
Reference in new issue
Block a user