测试视频复刻

This commit is contained in:
Azmat@qq.com
2026-08-31 10:13:56 +08:00
parent 6b6146e595
commit 284748eeff
7 changed files with 193 additions and 245 deletions
+6 -3
View File
@@ -44,7 +44,7 @@ FREE_VIDEO_MODELS = {
"doubao-seedance-2-0-mini-260615",
}
HIGH_RES_MODEL = "doubao-seedance-2-0-260128" # 1080p/4k 仅标准档(火山限制)
# 视频复刻固定用这一档:只有它支持 30 秒单次出片
# 视频复刻固定 Seedance 2.5(单次最长 30 秒)。原片只用来提炼分镜,不传给火山。
REPLACE_MODEL = "doubao-seedance-2-5-260628"
# 出片时长的兜底上限。真实上限按 ModelConfig.metadata.durations 取(见 model_duration_range),
# 元数据缺失时回落这里 —— 别写死 15,否则新模型上来就被老常量卡住。
@@ -350,7 +350,7 @@ def build_content_items(
if audio_n > 0 and image_n + video_n == 0:
raise ValueError("音频不能单独作为参考素材,请同时提供参考图片或视频")
if video_duration_total > max_ref_seconds:
# 上限跟着模型走:自由创作是 Seedance 2.0(15 秒),视频复刻走 2.5(30 秒)。
# 上限跟着模型走:2.0 是 15 秒,2.5 是 30 秒。
raise ValueError(f"参考视频总时长不能超过 {int(max_ref_seconds)} 秒,请缩短后重试")
# @label 替换:按 label 长度降序,防子串吞噬
@@ -619,7 +619,10 @@ def start_pending_free_video(task: AITask) -> AITask:
seed = int(payload.get("seed") if payload.get("seed") is not None else -1)
except (TypeError, ValueError):
seed = -1
references = payload.get("references") or []
references = list(payload.get("references") or [])
if feature == "video_replace":
# 复刻:用户原片只用来提炼,绝不能进 Seedance,否则真人素材直接被火山拒。
references = [item for item in references if (item or {}).get("type") != "video"]
try:
built = build_content_items(
team=task.team, prompt=prompt, mode=mode, references=references,