diff --git a/core/frontend/src/routes/pipeline.tsx b/core/frontend/src/routes/pipeline.tsx index 6f4ff5a..df194d8 100644 --- a/core/frontend/src/routes/pipeline.tsx +++ b/core/frontend/src/routes/pipeline.tsx @@ -998,6 +998,12 @@ export function PipelinePage(props: { const [setupSource, setSetupSource] = useState<"ai" | "theme" | "manual">("ai"); const [setupStyle, setSetupStyle] = useState(project.metadata?.wizard?.script_style || SETUP_STYLE_KEYS[0] || "pain"); const [setupPersona, setSetupPersona] = useState(project.metadata?.wizard?.persona || SETUP_PERSONA_KEYS[0] || "urban"); + // 向导选的成片时长档("0-30"→30 秒)传给脚本 agent —— 脚本按它定镜数,别再写死 60(否则选 30s 也按 60s 出) + const wizardTotalDuration = (() => { + const raw = project.metadata?.wizard?.duration; + const m = /(\d+)\s*$/.exec(typeof raw === "string" ? raw : ""); + return m ? Number(m[1]) : 60; + })(); const chatTextareaRef = useRef(null); const chatFileRef = useRef(null); const chatBodyRef = useRef(null); @@ -1152,7 +1158,7 @@ export function PipelinePage(props: { model_config_id: activeScriptModelId || undefined, base_version_id: baseVersionId, aspect_ratio: "9:16", - total_duration: 60, + total_duration: wizardTotalDuration, target_index: targetIndex }, (evt) => {