auto-save 2026-05-13 20:51 (~7)
This commit is contained in:
@@ -15,6 +15,7 @@ interface Props {
|
||||
onJobUpdate?: (j: Job) => void
|
||||
clipboard: ImageRef | null // 全局剪贴板(page.tsx 提供)
|
||||
focusedFrame: number | null
|
||||
videoConfigured?: boolean
|
||||
onGenerateVideo?: (frameIdx: number, scene: StoryboardScene, model: string) => Promise<void> | void
|
||||
}
|
||||
|
||||
@@ -28,7 +29,7 @@ const VIDEO_MODELS = [
|
||||
{ value: "veo3", label: "Veo 3" },
|
||||
] as const
|
||||
|
||||
export function StoryboardWorkbench({ job, selectedFrames, open, onClose, onJobUpdate, clipboard, focusedFrame, onGenerateVideo }: Props) {
|
||||
export function StoryboardWorkbench({ job, selectedFrames, open, onClose, onJobUpdate, clipboard, focusedFrame, videoConfigured, onGenerateVideo }: Props) {
|
||||
const [mounted, setMounted] = useState(false)
|
||||
useEffect(() => setMounted(true), [])
|
||||
|
||||
@@ -124,6 +125,7 @@ export function StoryboardWorkbench({ job, selectedFrames, open, onClose, onJobU
|
||||
|
||||
const hasVideoRefs = !!(form.subject_image || form.scene_image || form.product_image || form.action_image)
|
||||
const currentModelLabel = VIDEO_MODELS.find((m) => m.value === videoModel)?.label ?? "Seedance"
|
||||
const videoUnavailable = videoConfigured === false
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -302,8 +304,13 @@ export function StoryboardWorkbench({ job, selectedFrames, open, onClose, onJobU
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
{videoUnavailable && (
|
||||
<div className="mb-2 rounded-md border border-amber-300/25 bg-amber-500/10 px-2.5 py-2 text-[10.5px] leading-relaxed text-amber-100/80">
|
||||
当前 SKG ezlink 只连通基础网关,但未开通生视频 /videos 端点;这里先禁用提交,避免继续产生失败任务。
|
||||
</div>
|
||||
)}
|
||||
<button
|
||||
disabled={!hasVideoRefs || focusedIdx === null || generating}
|
||||
disabled={videoUnavailable || !hasVideoRefs || focusedIdx === null || generating}
|
||||
onClick={async () => {
|
||||
if (focusedIdx === null) return
|
||||
queueSave(form)
|
||||
@@ -315,13 +322,15 @@ export function StoryboardWorkbench({ job, selectedFrames, open, onClose, onJobU
|
||||
}
|
||||
}}
|
||||
className="w-full py-3 rounded-lg text-[13.5px] font-semibold inline-flex items-center justify-center gap-2 bg-gradient-to-r from-rose-500 to-violet-500 text-white border border-violet-300/40 shadow-lg shadow-violet-500/20 hover:from-rose-400 hover:to-violet-400 disabled:opacity-40 disabled:cursor-not-allowed"
|
||||
title={hasVideoRefs ? `调用 ${currentModelLabel} 生视频 API,结果进入 Video Gen 节点` : "先粘贴至少一张参考图"}
|
||||
title={videoUnavailable ? "当前视频 API 未开通" : hasVideoRefs ? `调用 ${currentModelLabel} 生视频 API,结果进入 Video Gen 节点` : "先粘贴至少一张参考图"}
|
||||
>
|
||||
{generating ? <Loader2 className="h-4 w-4 animate-spin" /> : <Wand2 className="h-4 w-4" />}
|
||||
调用 {currentModelLabel} 生成视频
|
||||
{videoUnavailable ? "视频 API 未开通" : `调用 ${currentModelLabel} 生成视频`}
|
||||
</button>
|
||||
<div className="mt-2 text-[10.5px] text-white/35 leading-relaxed">
|
||||
用当前 4 图槽、改造目标和时长提交生视频 API;生成中的进度和完成后的 MP4 会显示在 Video Gen 节点。
|
||||
{videoUnavailable
|
||||
? "需要 IT 给当前 key 分组开通 /videos,或配置外部 VIDEO_API_BASE_URL/VIDEO_API_KEY 后再生成。"
|
||||
: "用当前 4 图槽、改造目标和时长提交生视频 API;生成中的进度和完成后的 MP4 会显示在 Video Gen 节点。"}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user