新增 MiniMax H3 Highspeed/Lite 与 Seedance 2.5 Flash,兼容视频参数和旧工作流

This commit is contained in:
Jony
2026-11-17 15:44:20 +08:00
parent af300996b9
commit 209100ecde
16 changed files with 598 additions and 70 deletions
+16 -3
View File
@@ -12,6 +12,8 @@ SEEDANCE_MODEL_OPTIONS = [
"seedance-2.0-mini",
"seedance-2.5",
]
# Panel choices stay curated; the shared capability registry also serves graph nodes.
SEEDANCE_25_MODELS = {"seedance-2.5", "seedance-2.5-flash"}
SEEDANCE_ROUTE_OPTIONS = ["domestic", "overseas_hc"]
SEEDANCE_ASSET_CREATION_MODE_OPTIONS = ["direct", "auto", "manual"]
VIDEO_GENERATION_MODE_OPTIONS = [
@@ -44,6 +46,7 @@ SEEDANCE_MODEL_MATRIX = {
("seedance-2.0-fast", "domestic"): "doubao-seedance-2-0-fast-260128-max",
("seedance-2.0-mini", "domestic"): "doubao-seedance-2-0-mini-260615-max",
("seedance-2.5", "domestic"): "doubao-seedance-2-5-260628-max",
("seedance-2.5-flash", "domestic"): "doubao-seedance-2-5-flash",
("seedance-2.0", "overseas_hc"): "dreamina-seedance-2-0-hc",
("seedance-2.0-fast", "overseas_hc"): "dreamina-seedance-2-0-fast-hc",
("seedance-2.0-mini", "overseas_hc"): "dreamina-seedance-2-0-mini-hc",
@@ -87,6 +90,15 @@ SEEDANCE_CAPABILITIES = {
"resolutions": ["480p", "720p", "1080p"],
"reference_seconds": 30,
},
"seedance-2.5-flash": {
"duration_min": 4,
"duration_max": 30,
"images": 10,
"videos": 5,
"audios": 5,
"resolutions": ["480p", "720p"],
"reference_seconds": 30,
},
}
@@ -111,7 +123,7 @@ def normalize_seedance_parameters(payload: dict[str, Any]) -> dict[str, Any]:
raise ValueError(f"暂不支持的视频提供方:{provider}")
model = str(payload.get("model") or "seedance-2.0").strip()
if model not in SEEDANCE_MODEL_OPTIONS:
if model not in SEEDANCE_CAPABILITIES:
raise ValueError(f"不支持的 Seedance 模型:{model}")
route = str(payload.get("route") or "domestic").strip()
if route not in SEEDANCE_ROUTE_OPTIONS:
@@ -155,12 +167,12 @@ def normalize_seedance_parameters(payload: dict[str, Any]) -> dict[str, Any]:
# 文档约束:2.5 的编辑/延长只用 adaptive,编辑必须显式 -1,首帧类也跟随图片比例
if mode in {"edit", "extend"}:
if model != "seedance-2.5":
if model not in SEEDANCE_25_MODELS:
raise ValueError("视频编辑和视频延长仅支持 Seedance 2.5")
aspect_ratio = "auto"
if mode == "edit":
duration = -1
if model == "seedance-2.5" and mode in {"first_frame", "first_last_frame"}:
if model in SEEDANCE_25_MODELS and mode in {"first_frame", "first_last_frame"}:
aspect_ratio = "auto"
filename_prefix = str(payload.get("filename_prefix") or "o1key_video").strip()
@@ -319,6 +331,7 @@ def public_video_capabilities() -> dict[str, Any]:
__all__ = [
"SEEDANCE_25_MODELS",
"MAX_VIDEO_PROMPT_CHARS",
"SEEDANCE_CAPABILITIES",
"SEEDANCE_ASSET_CREATION_MODE_OPTIONS",
+3 -2
View File
@@ -23,6 +23,7 @@ from .config import get_base_url_by_route
from .http_error import format_o1key_video_error
from .o1key_image_save import normalize_save_location
from .o1key_video_catalog import (
SEEDANCE_25_MODELS,
SEEDANCE_REFERENCE_AUDIO_EXTENSIONS,
SEEDANCE_REFERENCE_AUDIO_MAX_BYTES,
SEEDANCE_REFERENCE_IMAGE_MAX_BYTES,
@@ -240,7 +241,7 @@ def normalize_video_job_payload(payload: Any) -> dict[str, Any]:
)
if (
mode == "multimodal"
and normalized["model"] != "seedance-2.5"
and normalized["model"] not in SEEDANCE_25_MODELS
and audio_total
and not image_total
and not video_total
@@ -248,7 +249,7 @@ def normalize_video_job_payload(payload: Any) -> dict[str, Any]:
raise ValueError("Seedance 2.0 系列不可单独使用参考音频")
if (
mode == "multimodal"
and normalized["model"] == "seedance-2.5"
and normalized["model"] in SEEDANCE_25_MODELS
and audio_total
and not image_total
and not video_total