@happyvertical/smrt-video (欢快的垂直)
S-m-r-t生态系统中AI动力视频生成的视频制作管道. 模型人物,表演者,场景,镜头,序列,组成,以及ComfyUI工作流程模板.
安装
pnpm add @happyvertical/smrt-video
使用量
import {
Character,
Performer,
Scene,
VideoShot,
VideoSequence,
VideoComposition,
VideoShotCharacter,
VideoWorkflow,
} from '@happyvertical/smrt-video';
import { Asset } from '@happyvertical/smrt-assets';
// Character = role being played (outfit, voice, branding)
const anchor = new Character({
name: 'Bentley News Anchor',
voiceProfileId: 'voice-123',
});
await anchor.save();
const seedImage = new Asset({
name: 'Anchor Seed',
sourceUri: 'file:///tmp/anchor-seed.png',
mimeType: 'image/png',
});
await seedImage.save();
await anchor.addAsset(seedImage, 'seed-image');
// Performer = physical likeness for IP-Adapter face consistency
const performer = new Performer({ name: 'Alex', ipAdapterWeight: 0.85 });
// Scene = virtual background (image, video, or 360 panorama)
const studio = new Scene({
name: 'News Studio',
sourceType: 'image',
projection: 'flat',
});
// Hierarchy: Composition -> Sequence -> Shot -> ShotCharacter
const composition = new VideoComposition({
title: 'Evening News - March 2, 2026',
fps: 30,
width: 1920,
height: 1080,
});
await composition.save();
const shot = new VideoShot({
scriptText: 'Welcome to the evening news broadcast.',
targetDuration: 30,
});
await shot.save();
// Estimated speech duration: scriptWordCount / 2.7 words per second
shot.estimatedDuration; // ~2.2 seconds
await shot.addAsset(seedImage, 'thumbnail');
// ComfyUI workflow with dynamic parameter injection
const workflow = new VideoWorkflow({
name: 'Wan 2.6 + EchoMimic',
workflowType: 'broadcast',
workflowJson: comfyuiApiJson,
nodeMapping: { seedImage: '1', audioFile: '5', outputVideo: '12' },
requiredModels: ['wan_2.6_t2v_14b_fp8', 'echomimic_v2'],
});
await workflow.save();
// Inject runtime parameters into a deep-cloned workflow
const injected = workflow.injectParameters({
seedImage: '/path/to/anchor.png',
audioFile: '/path/to/tts.wav',
});
API 密码
模型
| 导出 | 说明 |
|---|---|
Character | 虚拟人物a:种子图像+语音简介+品牌工具包 |
Performer | IP- Adapter FaceID 一致性的物理相似性 |
Scene | 有观点、照明和锚点的虚拟背景 |
VideoShot | 具有脚本和帧长度的原子生成单元(扩展内容) |
VideoShotCharacter | 接合器:有作用的相机(一级/二级/背景) |
VideoSequence | 主题部分( 扩展内容) 有过渡类型和顺序 |
VideoComposition | 顶级容器( 扩展内容): fps, 分辨率, 渲染状态 |
VideoWorkflow | ComfyUI 模板, 用于输入参数的节点映射 |
CompositeJob | 跟踪多步视频生成任务 |
收藏: CharacterCollection, (中文(简体) ), VideoCompositionCollection, (中文(简体) ), VideoSequenceCollection, (中文(简体) ), VideoShotCollection, (中文(简体) ), VideoShotCharacterCollection。 。 。 .
加农资产加入:
CharacterOwnedAsset- > (中文)character_assetsPerformerOwnedAsset- > (中文)performer_assetsSceneOwnedAsset- > (中文)scene_assetsVideoShot, (中文(简体) ),VideoSequence,以及VideoComposition继承Content资产助手content_assets
科技和创新遗产资产分类 CharacterAsset, (中文(简体) ), PerformerAsset, (中文(简体) ), SceneAsset, (中文(简体) ), VideoCompositionAsset, (中文(简体) ), VideoSequenceAsset,以及 VideoShotAsset 迁移时仍可读取,但新作应该通过模型帮助.
提供新的合并表格 smrt db:migrate 之前依赖犬科写作。 当新表格尚未出现时,读取仍然会回到遗留字段/科学、技术和创新行.
密钥类型
| 导出 | 说明 |
|---|---|
CharacterStatus | pending, (中文(简体) ), ready |
BrandingConfig | 标记、 颜色、 字体、 下端、 滴答设置 |
WorkflowType | prebake, (中文(简体) ), broadcast, (中文(简体) ), lipsync, (中文(简体) ), postprod, (中文(简体) ), custom |
NodeMapping | 将语义名称(种子图像、音频文件等)映射到ComfyUI节点ID |
RenderStatus | draft, (中文(简体) ), rendering, (中文(简体) ), ready, (中文(简体) ), failed |
VideoShotStatus | draft, (中文(简体) ), queued, (中文(简体) ), processing, (中文(简体) ), ready, (中文(简体) ), failed, (中文(简体) ), published |
TransitionType | none, (中文(简体) ), fade, (中文(简体) ), slide, (中文(简体) ), wipe |
VideoMetadata | 持续时间, 分辨率, 编码器, fps, 单词计时 |
SceneSourceType | image, (中文(简体) ), video, (中文(简体) ), panorama_360, (中文(简体) ), panorama_180 |
VideoShotCharacterRole | primary, (中文(简体) ), secondary, (中文(简体) ), background |
设计原则
存储相框,计算秒。 所有使用期间 durationInFrames; 转换为 frames / fps发言时间估计为2.7个字/秒(+/-15%容忍度).
资产所有权
Character, (中文(简体) ), Performer,以及 Scene 曝光 getAssets(), (中文(简体) ), getAssetByRole(), (中文(简体) ), addAsset(),以及 removeAsset() {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}在冠名词表上 在移徙期间,他们继续阅读遗留的斯卡尔槽和遗留的科学、技术和创新资产行.
VideoShot, (中文(简体) ), VideoSequence,以及 VideoComposition 继承同一助手 Content,所以他们的犬类所有权表是 content_assets 而不是一个视频专用的加入表.
依赖关系
@happyvertical/smrt-core-- ORM 和代码生成@happyvertical/smrt-assets- 基础资产管理@happyvertical/smrt-config-- 配置装入@happyvertical/smrt-content-- 内容模型(视频/序列/组合扩展内容)@happyvertical/smrt-profiles-- 字符配置参考@happyvertical/smrt-tenancy-- 多租户范围界定@happyvertical/smrt-voice-- 语音简介参考文献