Job
一个视频任务。前端维护多个 jobs[],当前激活的是 activeJobId。URL 查询参数会持久化多个 job。
Job {
id, url, status, progress, message,
owner_id, owner_name, owner_email, owner_provider, tenant_key,
video_url, source_audio_url, duration, width, height,
frames: KeyFrame[],
transcript: TranscriptSegment[],
audio_script: AudioScript,
subject_agent: SubjectAgentState,
storyboard_images?: StoryboardImage[],
product_refs?: ProductRefStateItem[]
}
AgentRun
一键出片终端的后台状态机。它不替代 Job,而是持有一个 job_id 并记录终端日志、阶段、生成视频 ID、审片图和最终 mp4。
AgentRun {
id, job_id,
owner_id, owner_name, owner_email, owner_provider, tenant_key,
status: draft | queued | executing | reviewing | completed | failed,
stage, progress,
logs: AgentRunLog[],
video_ids: string[],
final_video_url,
contact_sheet_url,
error,
created_at, updated_at
}
CanvasProject
根域名画布的项目持久化模型。前端仍保留本地缓存,但服务端 canvas_projects 是公司内部沉淀的主存储;默认可见性为 private,只有 owner 可改写,后续可扩展 team/company 可见项目。
CanvasProject {
id,
owner_id, owner_name, owner_email, owner_provider, tenant_key,
name,
thumbnail,
visibility: private | team | company,
canvas_data: { nodes, edges, viewport, ... },
version,
created_at, updated_at, deleted_at
}
Postgres 索引表
Postgres 不替代大文件和完整 job state;它负责跨用户、跨浏览器和后续后台管理需要的结构化索引。任务详情、媒体文件和资源库原始 manifest 仍保留在现有目录里。
app_users
canvas_projects
job_index
generated_assets
prompt_library_index
asset_library_index
agent_run_index
audit_events
KeyFrame
关键帧是整个产品的核心单位。index 是稳定 ID,手动加帧后不连续,不能用数组下标代替。
KeyFrame {
index, timestamp, url,
description,
transparent_human_score,
cleaned_url, cleaned_applied,
quality_report,
scene_assets: SceneAsset[],
elements: KeyElement[],
storyboard: StoryboardScene,
generated_images: GeneratedImage[]
}
SubjectAgentState
转换层生图对话的项目内记忆。它跟随 Job 写入 state.json,保存当前参考帧、模型套件、识别摘要、对话要求、最终英文提示词、方向和数量;主界面会用这些字段驱动同一输入区里的“提示词就绪”和“确认生成 N 张”按钮,用户点击后才生成主体套图。
SubjectAgentState {
model_bundle: "gpt" | "gemini",
source_frame_indices: number[],
analysis?: SubjectAgentAnalysis,
messages: SubjectAgentMessage[],
selected_mode: "realistic" | "cartoon" | "elements" | "custom",
selected_traits: string[],
requirements_zh,
generation_prompt_en,
quantity,
updated_at
}
TransparentHumanFrameScore
透明骨架人主题的抽帧验收结果。只有 target=transparent_human 时会在抽帧阶段写入;普通抽帧目标不要求该字段。
TransparentHumanFrameScore {
transparent_body_score: 0-25,
skeleton_visible_score: 0-25,
human_prominence_score: 0-15,
clarity_score: 0-15,
commercial_style_score: 0-10,
product_usefulness_score: 0-10,
total_score,
qualified,
reject_reason
}
KeyElement
从关键帧识别结果里确认出来的主体候选。当前素材准备流程只保留一个统一主体;多张关键帧通过 source_frame_indices 作为该主体的参考帧。
KeyElement {
id,
name_zh, name_en, position,
source: auto | manual | region,
region,
cutouts: string[],
cutout_id,
subject_kind: object | living,
subject_assets: SubjectAsset[],
subject_consensus_brief,
subject_consensus_brief_zh
}
AudioScript
第一步音频解析的结构化产物。pipeline_transcribe 提取 audio.wav 后先保存原语言转写(支持中文、英文和其他多语言)、中文镜像、讲话人画像、口播节奏和背景音乐/环境声/音效分析。rewritten_text 是英文新口播,rewritten_text_zh 只作为团队审稿镜像;voice_url 等字段仍保留给后续新配音阶段。
AudioScript {
status: idle | rewriting | completed | failed,
source_text,
source_zh,
rewritten_text,
rewritten_text_zh,
speaker_profile,
rhythm_profile,
background_audio_profile,
product_brief,
rewrite_model,
voice_provider: azure_openai,
voice_model,
voice_id,
voice_url,
error
}
SceneAsset / SubjectAsset
画面工作台素材准备阶段生成的组图资产。实际图片保存在 jobs/<jobId>/assets,可作为 asset 类型复制到分镜槽位。
SceneAsset {
id, label, url,
width, height, quality, size,
scene_mode: remove_subject | similar | style,
scene_style,
quality_report
}
SubjectAsset {
id, view, label, url,
background: white | black,
width, height, size,
source_frame_indices[],
status: queued | in_progress | completed | failed,
progress, error,
pack_id, pack_label, pack_mode, pack_created_at
}
SubjectTemplateItem 保存用户确认过的主体视图包。prompt_brief 是后端从模板图反推的英文文字特征,后续相似生成优先读取它,而不是再次把模板图作为强参考图传给 image-edit;prompt_brief_zh 仅用于模板库卡片和团队阅读。
SubjectTemplateItem {
id, name, description, note,
prompt_brief,
prompt_brief_zh,
subject_style: transparent_human | source_actor | cartoon_subject,
primary_image,
images: SubjectTemplateImage[]
}
ProductLibraryItem
内置 SKG 白底图库条目。实际图片保存在 api/product_library/skg-products/images,被选中时会复制到 jobs/<jobId>/assets,再以普通 ImageRef(kind="asset") 进入产品参考组。
ProductLibraryItem {
id, handle, title, product_type,
image_index, filename, url,
width, height,
white_score,
source_path,
tags[]
}
PromptLibraryItem / AssetLibraryItem
全局资源中心的数据模型。提示词库只保存文本和中英镜像,发给模型时使用 prompt_en;素材库保存主体、产品、场景和视频四类全局资源。库目录和 job 目录完全平级,索引文件只是缓存,服务启动会扫描目录重建。素材应用到 job 时永远复制文件,返回普通 ImageRef(kind="asset") 或 job 内视频引用,不把 library_* 引用写入 job state。
PromptLibraryItem {
id,
category: scene_desc | video_desc | subject_desc | skg_script | product_angle,
name,
tags[],
prompt_en,
prompt_zh,
use_count,
source_job_id,
created_at,
updated_at
}
AssetLibraryItem {
id,
kind: subjects | products | scenes | videos,
name,
name_zh,
note,
tags[],
source_job_id,
use_count,
created_at,
updated_at,
is_official,
prompt_brief,
prompt_brief_zh,
subject_style,
product_type,
asset_role,
duration,
aspect_ratio,
images: AssetLibraryImage[],
poster,
video_url
}
ImageRef.asset_meta
产品图上传或从产品图库复制到 job 时,后端会把原图转为统一 AI 工作副本,避免超高清原图拖慢识别、生图和生视频链路。黑底/白底不强行改色;只有透明底会铺白。前端用该字段展示工作图尺寸、自动转换动作和分辨率风险。
asset_meta {
standard: "AI工作副本:最长边≤1600px,建议长边≥900px,短边≥600px,JPEG q92",
original_width, original_height,
width, height,
original_bytes, work_bytes,
max_side, min_long_side, min_short_side, quality,
actions[],
warnings[],
normalized
}
ProductViewAnalysisItem
产品素材池识别结果。它不判断不同产品身份,只服务同一款挂脖肩颈按摩仪的生视频选图和方向约束;左/右按佩戴者身体左右,不按图片左右。前端会把上传图、识别标注、AI 补图、备注和删除结果写入 Job.product_refs,后端保存到 state.json,避免刷新、热更新或服务重启后丢失产品素材池。
ProductViewAnalysisItem {
index,
view: front | left_45 | right_45 | side_thickness | inner_contacts | back_bottom,
background,
use_tags[],
orientation: {
product_left, product_right,
top, bottom,
inner_side, outer_side,
opening_direction
},
landmarks[],
note,
risk,
confidence
}
ProductRefStateItem {
id,
ref: ImageRef,
view,
background,
useTags[],
orientation,
landmarks[],
note,
risk,
source: upload | ai,
assetMeta,
confidence
}
ProductFusionShot
产品融合镜头组的单行数据。每个关键帧最多 6 行,用户选择一个内置角色后只微调场景/产品使用/享受描述和秒数;四张桌面 SKG 产品角度图会在顶部显式展示为真实产品真源,所选角色 7 张参考图作为人物身份参考,生成时作为 Seedance 参考图提交。
ProductFusionShot {
id,
first_image,
last_image,
product_images[4],
action_text,
duration,
image_model: gpt-image-2,
video_model: seedance,
// legacy: product_image, person_image, product_region, scene_image, guide_image
}
StoryboardScene
分镜编排结果,不是复刻说明。当前主流程里 first_image/last_image 只接受生成后的 asset 首尾帧;旧 keyframe 首尾帧引用会被前端忽略。subject_images 保存相似主体白底视图,product_images 保存该行挑选的产品参考。
StoryboardScene {
duration,
visual_mode: person_only | person_product | product_only | environment,
needs_product,
needs_subject,
subject_brief,
skg_copy_en,
skg_copy_zh,
scene_one_line_en,
scene_one_line_zh,
action_one_line_en,
action_one_line_zh,
selected_video_id,
first_frame_plan,
last_frame_plan,
product_placement,
first_image,
last_image,
product_images[],
subject_images[],
subject_image,
scene_image,
product_image,
action_image,
subject,
product,
scene,
action
}