| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- /**
- * Pipeline 注册中心
- *
- * 借鉴 Pixelle-Video 的双层 Pipeline 抽象(前端 PipelineUI + 后端 BasePipeline),
- * 在本项目中以"插件元数据 + 路由 tab key"的最小可用形式落地。
- *
- * 后续每新增一种生成模式:
- * 1. 在 PIPELINES 数组中追加一条
- * 2. 在 app.ts 的 setCurrentTab / restoreCurrentTab 类型联合中加入对应 route
- * 3. 在 app.html 中为 currentTab === route 添加对应 <section>
- * 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/<id>.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:
- '<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle>',
- route: 'digital-human',
- status: 'stable',
- showInSidebar: true,
- },
- {
- id: 'video_generation',
- displayName: '标准视频生成',
- description: '上传视频后通过 AI 进行重塑、字幕与配音改造',
- inputHint: '原始视频 + 改造指令',
- iconSvg:
- '<polygon points="23 7 16 12 23 17 23 7"></polygon><rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect>',
- route: 'video-generation',
- status: 'beta',
- showInSidebar: true,
- },
- {
- id: 'image_to_video',
- displayName: '图生视频',
- description: '上传一张或两张图片(首帧/首尾帧),配合提示词生成动态短视频',
- inputHint: '图片 + 提示词 + 时长',
- iconSvg:
- '<rect x="3" y="3" width="18" height="14" rx="2"></rect><circle cx="9" cy="9" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline>',
- route: 'image-to-video',
- status: 'beta',
- showInSidebar: true,
- },
- {
- id: 'action_transfer',
- displayName: '动作迁移',
- description: '基于即梦 Actor v2:上传角色图 + 参考视频,让角色按视频动作驱动起来',
- inputHint: '角色图 + 参考动作视频',
- iconSvg:
- '<circle cx="12" cy="5" r="2"></circle><path d="M12 7v6"></path><path d="M8 21l4-8 4 8"></path><path d="M6 11l6-3 6 3"></path>',
- route: 'action-transfer',
- status: 'beta',
- showInSidebar: true,
- },
- {
- id: 'asset_remix',
- displayName: '素材合成视频',
- description: '上传多张图片 + 主题,AI 生成口播文案 + TTS 配音 + ffmpeg 拼接成片',
- inputHint: '3-10 张图片 + 主题 + 音色',
- iconSvg:
- '<rect x="3" y="3" width="7" height="7" rx="1"></rect><rect x="14" y="3" width="7" height="7" rx="1"></rect><rect x="3" y="14" width="7" height="7" rx="1"></rect><rect x="14" y="14" width="7" height="7" rx="1"></rect>',
- route: 'asset-remix',
- status: 'beta',
- showInSidebar: true,
- },
- {
- id: 'topic_to_video',
- displayName: '主题生视频',
- description: '一句话主题,LLM 拆分镜 → 即梦文生图 → TTS 配音 → ffmpeg 全自动拼接',
- inputHint: '一句话主题(全自动)',
- iconSvg:
- '<circle cx="12" cy="12" r="9"></circle><path d="M12 7v5l3 2"></path>',
- 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,
- );
|