Files
video-create/.claude/skills/video-from-script/references/account-system.md
sion123 96f00ce7fd feat(video-pipeline): 将 narration 字段统一重命名为 script
字段重命名涉及所有文档、示例代码、提示词模板以及 slug 生成逻辑,确保管线各阶段(分镜、图生提示词、TTS、成片)一致使用 script 字段承载口播文案。

同时增强 `capcut_assemble.js` 的配音与字幕模块:
- 配音支持本地路径模式(不上传 OSS),新增 `--split-captions` 参数启用分句字幕
- 分句字幕按标点切分长文本为短句,基于字数权重动态分配显示时长
- 新增 `update-captions-standalone.js` 独立工具,可在草稿已生成后单独更新字幕
2026-05-01 02:48:37 +08:00

147 lines
5.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 账号系统规范
> 每个账号独立管理视觉风格、提示词策略和 CapCut 配置。
> 视觉风格直接内嵌在 prompts/*.md 中,无需单独的 styles/ 目录。
---
## 目录结构
```
accounts/ # 项目根目录下
├── _template/ # 新账号模板(含通用 prompt 模板)
│ ├── account.json
│ ├── prompts/ # 通用提示词模板(生成账号 prompt 的基础)
│ │ ├── 通用分镜.md
│ │ ├── 通用图片.md
│ │ └── 通用视频.md
│ └── references/ # 参考图目录
│ └── .gitkeep
└── {account}/ # 用户创建的账号(目录名 = account.json 的 id
├── account.json
├── prompts/ # 账号专属提示词(基于通用模板 + 风格注入生成)
│ ├── 分镜.md # 口播文案 → 分镜表
│ ├── 图片提示词.md # shotDesc → imagePrompt
│ └── 视频提示词.md # shotDesc → videoPrompt
└── references/ # 参考图(生图时作为参考输入)
├── ref_001.png
└── ref_002.png
```
---
## account.json 字段说明
```json
{
"id": "tech-talk",
"name": "科技解说",
"description": "科技类短视频账号,深色背景,赛博朋克风格",
"imageModel": "gemini",
"videoModel": "kling",
"batchSize": 30,
"storyboardPrompt": "prompts/分镜.md",
"imageStylePrompt": "prompts/图片提示词.md",
"videoStylePrompt": "prompts/视频提示词.md",
"references": [
{ "file": "ref_001.png", "url": "https://oss.../ref_001.png" }
],
"capcut": {
"effects": ["录制边框 III"],
"filter": "电影感:40",
"subtitleStyle": {
"fontSize": 36,
"color": "#FFFFFF",
"highlightColor": "#FF6B35",
"bold": true
},
"defaultBGM": "https://example.com/bgm_tech.mp3"
}
}
```
| 字段 | 类型 | 说明 |
|------|------|------|
| `id` | string | 账号唯一标识(与目录名一致) |
| `name` | string | 账号显示名 |
| `description` | string | 一句话描述 |
| `defaultFormat` | string | 默认画幅9:16 / 16:9 / 1:1 / 4:3 |
| `imageModel` | string | 默认图片模型 |
| `videoModel` | string | 默认视频模型 |
| `batchSize` | number | 默认批量生成数量 |
| `storyboardPrompt` | string | 分镜提示词模板路径(相对于账号目录) |
| `imageStylePrompt` | string | 图片提示词模板路径(相对于账号目录) |
| `videoStylePrompt` | string | 视频提示词模板路径(相对于账号目录) |
| `references` | array | 参考图列表,每项含 file本地文件名和 urlOSS 公网地址) |
| `capcut.effects` | string[] | CapCut 特效名称列表 |
| `capcut.filter` | string | CapCut 滤镜,格式 "名称:强度" |
| `capcut.subtitleStyle` | object | 字幕样式(字号、颜色、高亮色、加粗) |
| `capcut.defaultBGM` | string | 默认背景音乐 URL |
---
## 提示词模板prompts/
每个账号在 `prompts/` 目录下维护三个子 Agent 提示词模板:
| 文件 | 用途 | Step |
|------|------|------|
| `分镜.md` | 口播文案 → 分镜表shotDesc/script/duration/directorRef | Step 1 |
| `图片提示词.md` | shotDesc + directorRef → imagePrompt | Step 2-A |
| `视频提示词.md` | shotDesc + directorRef → videoPrompt | Step 3-A |
这些文件定义了子 Agent 的角色、入参、出参、词库和示例。路径在 account.json 中以相对路径引用Agent 读取 account.json 后自动定位。
### 生成方式
账号的 prompts 基于 `_template/prompts/通用*.md` 生成:
- 通用模板提供**方法论骨架**(切割规则、导演词库、写法规范、输出格式、质量自检)
- 创建账号时通过 Q&A 收集风格信息,注入到骨架的固定位置
- 详细流程见 [account-creation.md](account-creation.md)
---
## 参考图references/
参考图用于生图时的风格引导Gemini 图生图 / MJ --sref
### 管理流程
1. 用户将参考图放入 `accounts/{id}/references/` 目录
2. Agent 上传到 OSS`node scripts/oss-upload.js accounts/{id}/references/{图片文件}`
3. 将返回的 URL 写入 account.json 的 `references` 数组
---
## 创建新账号
### Q&A 创建(推荐)
用户说"创建账号"或"新账号"时Agent 按 [account-creation.md](account-creation.md) 的结构化问答流程执行:
1. 逐项询问:账号身份 → 内容 DNA → 视觉身份 → 技术配置
2. 基于通用模板 + 用户回答生成 3 个 prompt 文件 + account.json
3. 校验完整性
### CLI 创建(辅助)
```bash
node scripts/pipeline.js create-account \
--id military \
--name "军事账号" \
--desc "军事主题短视频,暗黑漫画风格" \
--video-model veo3-fast-frames \
--references ./ref1.png,./ref2.png
```
自动完成:创建目录 → 生成 account.json → 复制参考图 → 上传 OSS → 回写 URL。
**注意**CLI 创建只生成目录结构和 account.json 骨架prompt 文件仍需通过 Q&A 流程或手动创建。
### 校验账号
```bash
node scripts/pipeline.js validate-account --account military
```
检查id 匹配、必填字段、prompts 模板存在、参考图完整性、OSS URL 有效。