auto-save 2026-05-13 16:17 (~3)

This commit is contained in:
2026-05-13 16:18:05 +08:00
parent 3cea152177
commit f891cbc2e2
3 changed files with 72 additions and 14 deletions

View File

@@ -47,13 +47,41 @@ export interface KeyElement {
created_at?: number
}
export interface ImageRef {
kind: "keyframe" | "cutout"
frame_idx: number
element_id?: string | null
cutout_id?: string | null
label?: string
}
export interface StoryboardScene {
subject: string
product: string
scene: string
action: string
duration: number
reference_ids: string[]
subject_image?: ImageRef | null
scene_image?: ImageRef | null
product_image?: ImageRef | null
action_image?: ImageRef | null
// v1 兼容
subject?: string
product?: string
scene?: string
action?: string
reference_ids?: string[]
}
// 把 ImageRef 解析成可显示的 src URL
export function resolveImageRefUrl(jobId: string, ref: ImageRef): string {
if (ref.kind === "keyframe") {
return effectiveFrameUrl(jobId, { index: ref.frame_idx, cleaned_applied: false })
}
if (ref.element_id && ref.cutout_id) {
if (ref.cutout_id === ref.element_id) {
// legacy v1
return cutoutUrl(jobId, ref.frame_idx, ref.element_id)
}
return cutoutUrl(jobId, ref.frame_idx, ref.element_id, ref.cutout_id)
}
return ""
}
export interface KeyFrame {