/** * Pipeline 注册中心 * * 借鉴 Pixelle-Video 的双层 Pipeline 抽象(前端 PipelineUI + 后端 BasePipeline), * 在本项目中以"插件元数据 + 路由 tab key"的最小可用形式落地。 * * 后续每新增一种生成模式: * 1. 在 PIPELINES 数组中追加一条 * 2. 在 app.ts 的 setCurrentTab / restoreCurrentTab 类型联合中加入对应 route * 3. 在 app.html 中为 currentTab === route 添加对应
* 4. 等模式稳定后,再将该 section 抽离为独立 Angular 组件 */ export type PipelineStatus = 'stable' | 'beta' | 'planned'; export type PipelineRoute = | 'digital-human' // 数字人口播(已成熟) | 'video-generation' // 标准 AI 重塑(旧版主入口,逐步迁移) | 'image-to-video' // 图生视频(P1 计划) | 'action-transfer' // 动作迁移(P2 计划) | 'asset-remix' // 素材→视频(P3 计划) | 'topic-to-video'; // 主题→视频(P4 计划) export interface PipelineDef { /** 唯一 id,对应后端 pipelines/.js */ id: string; /** 显示名(中文) */ displayName: string; /** 简短描述(中文,用于 hub 卡片) */ description: string; /** 输入说明("上传 X / 输入 Y") */ inputHint: string; /** 内联 SVG path 字符串(24x24 viewBox) */ iconSvg: string; /** 路由 / tab key */ route: PipelineRoute; /** 成熟度 */ status: PipelineStatus; /** 是否在侧栏显示。planned 项默认仅在 hub 中显示 */ showInSidebar: boolean; } export const PIPELINES: readonly PipelineDef[] = [ { id: 'digital_human', displayName: '数字人合成', description: '上传参考视频或形象图,结合脚本与音色生成数字人口播视频', inputHint: '参考视频 / 形象图 + 脚本 + 音色', iconSvg: '', route: 'digital-human', status: 'stable', showInSidebar: true, }, { id: 'video_generation', displayName: '标准视频生成', description: '上传视频后通过 AI 进行重塑、字幕与配音改造', inputHint: '原始视频 + 改造指令', iconSvg: '', route: 'video-generation', status: 'beta', showInSidebar: true, }, { id: 'image_to_video', displayName: '图生视频', description: '上传一张或两张图片(首帧/首尾帧),配合提示词生成动态短视频', inputHint: '图片 + 提示词 + 时长', iconSvg: '', route: 'image-to-video', status: 'beta', showInSidebar: true, }, { id: 'action_transfer', displayName: '动作迁移', description: '基于即梦 Actor v2:上传角色图 + 参考视频,让角色按视频动作驱动起来', inputHint: '角色图 + 参考动作视频', iconSvg: '', route: 'action-transfer', status: 'beta', showInSidebar: true, }, { id: 'asset_remix', displayName: '素材合成视频', description: '上传多张图片 + 主题,AI 生成口播文案 + TTS 配音 + ffmpeg 拼接成片', inputHint: '3-10 张图片 + 主题 + 音色', iconSvg: '', route: 'asset-remix', status: 'beta', showInSidebar: true, }, { id: 'topic_to_video', displayName: '主题生视频', description: '一句话主题,LLM 拆分镜 → 即梦文生图 → TTS 配音 → ffmpeg 全自动拼接', inputHint: '一句话主题(全自动)', iconSvg: '', route: 'topic-to-video', status: 'beta', showInSidebar: true, }, ] as const; /** 仅返回侧栏显示的 pipelines */ export function getSidebarPipelines(): readonly PipelineDef[] { return PIPELINES.filter((p) => p.showInSidebar); } /** 全部允许的 route,供类型守卫与 setCurrentTab 校验 */ export const PIPELINE_ROUTES: readonly PipelineRoute[] = PIPELINES.map( (p) => p.route, );