fix(media): reject unsupported Wan 2.2 video size

This commit is contained in:
Bingxi Zhao (Frank)
2026-09-27 03:20:17 +08:00
parent a2e487dfcf
commit bc6d73de10
2 changed files with 5 additions and 1 deletions

View File

@@ -46,7 +46,7 @@ _SIZES_BY_TIER = {
_MODEL_TIERS = {
"wanx2.1-t2v-turbo": ("720p", {"480p", "720p"}),
"wanx2.1-t2v-plus": ("720p", {"720p"}),
"wan2.2-t2v-plus": ("1080p", {"480p", "720p", "1080p"}),
"wan2.2-t2v-plus": ("1080p", {"480p", "1080p"}),
"wan2.5-t2v-preview": ("1080p", {"480p", "720p", "1080p"}),
"wan2.6-t2v": ("1080p", {"720p", "1080p"}),
}

View File

@@ -396,6 +396,8 @@ async def test_dashscope_videogen_task_polls_and_downloads(
[
("wanx2.1-t2v-turbo", "9:16", "480p", "480*832"),
("wanx2.1-t2v-turbo", "1:1", "", "960*960"),
("wan2.2-t2v-plus", "16:9", "480p", "832*480"),
("wan2.2-t2v-plus", "4:3", "1080p", "1632*1248"),
("wan2.6-t2v", "4:3", "1080p", "1632*1248"),
("wan2.6-t2v", "", "1280*720", "1280*720"),
],
@@ -413,6 +415,8 @@ def test_dashscope_videogen_uses_concrete_size(
("model", "ratio", "resolution", "message"),
[
("wanx2.1-t2v-plus", "16:9", "480p", "does not support 480p"),
("wan2.2-t2v-plus", "16:9", "720p", "does not support 720p"),
("wan2.2-t2v-plus", "", "1280*720", "does not support 720p"),
("wanx2.1-t2v-turbo", "4:3", "480p", "Unsupported DashScope"),
("wanx2.1-t2v-turbo", "9:16", "1280*720", "conflicts with aspect ratio"),
],