hit-cxf
2026-04-06 2f49515c5073e17531d1cfca49cc2074a07453fd
同步更新了skill
15 files modified
459 ■■■■■ changed files
aigc-director/SKILL.md 44 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/core/agents/reference_agent.py 3 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/docs/api.md 12 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/docs/session_format.md 59 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/prompts/character/character_zh.txt 5 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/prompts/reference/first_frame_en.txt 11 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/prompts/reference/first_frame_zh.txt 11 ●●●●● patch | view | raw | blame | history
aigc-director/aigc-claw/backend/prompts/script/meta_extract_zh.txt 4 ●●●●● patch | view | raw | blame | history
aigc-director/references/workflow/create_character.md 2 ●●●●● patch | view | raw | blame | history
aigc-director/references/workflow/create_post.md 19 ●●●●● patch | view | raw | blame | history
aigc-director/references/workflow/create_project.md 105 ●●●●● patch | view | raw | blame | history
aigc-director/references/workflow/create_reference.md 18 ●●●●● patch | view | raw | blame | history
aigc-director/references/workflow/create_script.md 114 ●●●●● patch | view | raw | blame | history
aigc-director/references/workflow/create_storyboard.md 36 ●●●●● patch | view | raw | blame | history
aigc-director/references/workflow/create_video.md 16 ●●●●● patch | view | raw | blame | history
aigc-director/SKILL.md
@@ -30,7 +30,6 @@
├── aigc-claw/                    ← 前后端项目代码
│   ├── backend/                  ← FastAPI 后端(端口 8000)
│   │   └── code/result/          ← 模型生成产物存放目录
│   │            ├── script/      ← 剧本产物
│   │            ├── image/       ← 图片产物(角色、场景、参考图)
│   │            └── video/       ← 视频产物
│   └── frontend/                 ← Next.js 前端(端口 3000)
@@ -50,21 +49,18 @@
---
## 阶段与停点(共9个)
## 阶段与停点(共6个)
| 停点 | 阶段 | phase 值 | 描述 | 操作 |
|------|------|----------|------|------|
| 1 | 项目配置 | - | 确认配置选项 | 展示配置 → 用户确认 |
| 2 | 剧本生成 | suggest_expand | 建议扩写 | 等待用户确认 |
| 3 | 剧本生成 | logline_selection | 选择情节 | 从3个候选中选择 |
| 4 | 剧本生成 | mode_selection | 选择模式 | 电影(4幕) / 微电影(1幕) |
| 5 | 剧本生成 | script_generation | 确认剧本 | 确认后继续 |
| 6 | 角色/场景设计 | - | 确认角色/场景图片 | 确认后继续 |
| 7 | 分镜设计 | - | 确认分镜列表 | 确认后继续 |
| 8 | 参考图生成 | - | 确认参考图 | 确认后继续 |
| 9 | 视频生成 | - | 确认视频片段 | 确认后继续 |
| 1 | 项目配置 | - | 确认配置选项,包括集数(默认4集,1-10) | 展示配置 → 用户确认 |
| 2 | 剧本生成 | script_generation | 确认全集剧本 | 确认后继续 |
| 3 | 角色/场景设计 | - | 确认角色/场景图片 | 确认后继续 |
| 4 | 分镜设计 | - | 确认分镜列表 | 确认后继续 |
| 5 | 参考图生成 | - | 确认参考图 | 确认后继续 |
| 6 | 视频生成 | - | 确认视频片段 | 确认后继续 |
> **注意**:`suggest_expand` 和 `logline_selection` 可能根据输入质量被跳过。
> **注意**:原有的部分复杂剧本流程(扩写、模式选择等)由于系统优化已简化,目前直接输出最终的剧本列表,以分集(`episode_number`)为单位。
---
@@ -98,12 +94,12 @@
1. 检查后端运行状态 → 未运行则参考 start_backend.md 启动 → 等待3秒 → 再次检查
2. 检查前端运行状态 → 未运行则参考 start_frontend.md 启动 → 等待5秒 → 再次检查
3. 检查 API Key 配置 → 读取 .env 文件,确认所需 API Key 已配置
4. 参考 create_project.md 询问用户项目配置 → 停点1(配置确认)→ 创建项目
5. 参考 create_script.md 执行剧本生成 → 停点2-5
6. 参考 create_character.md 执行角色设计 → 停点6
7. 参考 create_storyboard.md 执行分镜设计 → 停点7
8. 参考 create_reference.md 执行参考图生成 → 停点8
9. 参考 create_video.md 执行视频生成 → 停点9
4. 参考 create_project.md 询问用户项目配置(集数等) → 停点1(配置确认)→ 创建项目
5. 参考 create_script.md 执行剧本生成 → 停点2
6. 参考 create_character.md 执行角色设计 → 停点3
7. 参考 create_storyboard.md 执行分镜设计 → 停点4
8. 参考 create_reference.md 执行参考图生成 → 停点5
9. 参考 create_video.md 执行视频生成 → 停点6
10. 参考 create_post.md 执行后期剪辑
11. 完成 → 发送最终视频给用户
```
@@ -167,22 +163,22 @@
### ❌ 错误示例(我刚才犯的错)
```
收到 suggest_expand 停点 → 直接调用 intervene → 跳过用户确认
收到确认剧情停点 → 直接调用 intervene → 跳过用户确认
```
### ✅ 正确示例
```
1. 阶段内部停点触发(如 suggest_expand)
收到 suggest_expand 停点
1. 阶段中间遇到不确定内容
收到 waiting_in_stage 停点
→ 获取 artifact 查看内容
→ 展示给用户:"系统建议启用创意扩写模式..."
→ 询问:"是否同意?"
→ 展示给用户选项
→ 询问:"是否同意修改?"
→ 用户回复"同意" → 调用 intervene
2. 阶段完成停点触发
收到 stage_completed 停点
→ 获取 artifact 查看产物内容
→ 展示给用户:"第一阶段已完成,生成了剧本内容..."
→ 展示给用户:"第一阶段已完成,生成了剧本内容(x集)..."
→ 询问:"是否继续下一阶段?"
→ 用户回复"继续" → 调用 continue
```
aigc-director/aigc-claw/backend/core/agents/reference_agent.py
@@ -558,11 +558,13 @@
                llm = LLM()
                selected_images = {}
                prompt_map = {}  # segment_id → first_frame_prompt
                def regen_run():
                    total = len(regen_scenes)
                    done = 0
                    nonlocal selected_images
                    nonlocal prompt_map
                    # 每片段5个步骤:准备(1)、生成(3)、完成(1)
                    steps_per_segment = 5
                    total_steps = total * steps_per_segment
@@ -571,7 +573,6 @@
                        return min(2 + int(98 * step / total_steps), 100)
                    # 根据最新的 Segment 生成对应的 visual_prompt
                    prompt_map = {}  # segment_id → first_frame_prompt
                    for i, segment_id in enumerate(regen_scenes):
                        seg = fresh_segment_map.get(segment_id, {})
                        
aigc-director/aigc-claw/backend/docs/api.md
@@ -40,6 +40,7 @@
{
  "idea": "故事线描述",
  "style": "anime",
  "episodes": 4,
  "llm_model": "qwen3.5-plus",
  "vlm_model": "qwen-vl-plus",
  "image_t2i_model": "doubao-seedream-5-0",
@@ -54,6 +55,7 @@
|------|------|------|------|--------|
| idea | string | 是 | 故事线描述 | - |
| style | string | 否 | 视频风格 | anime |
| episodes | int | 否 | 生成的剧集数量 | 4 |
| llm_model | string | 否 | LLM 模型 | qwen3.5-plus |
| vlm_model | string | 否 | VLM 评估模型 | qwen-vl-plus |
| image_t2i_model | string | 否 | 文生图模型 | doubao-seedream-5-0 |
@@ -65,11 +67,13 @@
```json
{
  "session_id": "1773208355389",
  "status": "running",
  "status": "stage_completed",
  "params": {
    "idea": "故事线描述",
    "style": "anime",
    "llm_model": "gemini-3-flash-preview"
    "llm_model": "gemini-3-flash-preview",
    "vlm_model": "qwen-vl-plus",
    "episodes": 4
  }
}
```
@@ -159,11 +163,11 @@
{
  "stage": "script_generation",
  "artifact": {
    "title": "影弑",
    "title": "剧本名称",
    "logline": "...",
    "characters": [...],
    "settings": [...],
    "scenes": [...]
    "episodes": [...]
  }
}
```
aigc-director/aigc-claw/backend/docs/session_format.md
@@ -9,6 +9,7 @@
| `session_id` | string | 会话唯一 ID |
| `idea` | string | 用户原始创意/故事想法 |
| `style` | string | 视觉风格,如 `realistic`、`anime` |
| `episodes` | int | 生成的剧集数量,默认 4 |
| `video_ratio` | string | 视频比例,如 `16:9`、`9:16` |
| `expand_idea` | bool | 是否扩展创意 |
| `llm_model` | string | LLM 模型名称 |
@@ -51,22 +52,25 @@
```json
{
  "project_id": "proj_xxx",
  "session_id": "...",
  "title": "守",
  "version": 1,
  "created_at": "2026-04-06T00:00:00.000Z",
  "metadata": {
    "generation_model": "模型名",
    "generation_prompt": "原始生成提示词",
    "original_text": "LLM生成的原始剧本文本"
  },
  "title": "剧本名称",
  "logline": "详细故事梗概",
  "genre": ["奇幻", "温情"],
  "target_duration": 180,
  "mood": "整体情绪基调",
  "characters": [
    {
      "name": "角色名",
      "character_id": "char_xxx",
      "description": "角色描述",
      "personality": ["特质1", "特质2"],
      "motivation": "角色动机",
      "arc_description": "角色弧线描述",
      "role": "主角/配角/反派",
      "age": "年龄",
      "species": "物种(人类/狗等)"
      "role": "主角/配角/反派"
    }
  ],
  "settings": [
@@ -76,31 +80,13 @@
      "description": "场景描述"
    }
  ],
  "scenes": [
  "episodes": [
    {
      "scene_number": 1,
      "location": "场景位置",
      "characters": ["角色名"],
      "plot": "场景剧情描述"
      "episode_number": 1,
      "act_title": "第一集标题",
      "content": "第一集的剧本正文内容"
    }
  ],
  "overall_style": "realistic",
  "mood": "整体情绪基调",
  "project_id": "proj_xxx",
  "version": 1,
  "metadata": {
    "generation_model": "模型名",
    "generation_prompt": "原始生成提示词",
    "mode": "movie/micro"
  },
  "logline_data": {
    "logline": "完整logline",
    "who": "主角是谁",
    "goal": "主角目标",
    "conflict": "核心冲突",
    "twist": "反转点",
    "theme": "主题"
  }
  ]
}
```
@@ -211,10 +197,19 @@
```json
{
  "session_id": "...",
  "final_video": "code/result/video/xxx_final.mp4"
  "final_videos": [
    {
      "episode": 1,
      "path": "code/result/video/xxx_ep1.mp4",
      "name": "第 1 集"
    }
  ],
  "final_video": "code/result/video/xxx_ep1.mp4"
}
```
> **注意**:`final_videos` 包含按剧集拼接的所有成片列表,`final_video` 保留为兼容第一集的字段。
---
## 跨阶段数据同步关系
aigc-director/aigc-claw/backend/prompts/character/character_zh.txt
@@ -1,5 +1,6 @@
角色设计参考图,{style} 风格,纯白背景。高画质,杰作,高画质。
角色描述: {name} — {desc}
角色设计参考图,{style} 风格,纯白背景。杰作,高画质。
角色名称:{name}
角色描述: {desc}
在同一排从左至右排列同一角色的 4 个视角:
1) 正面肖像(胸部以上),
2) 正面全身照,
aigc-director/aigc-claw/backend/prompts/reference/first_frame_en.txt
@@ -11,8 +11,9 @@
[Requirements]
1. The prompt must focus solely on the **first frame** composition of this video segment. Primarily describe the initial action, the relative positions of the characters, the environmental layout, and the lighting/atmosphere.
2. You must integrate visual details from the Character and Setting Descriptions accurately into the scene.
3. Do not describe precise texts, lettering, or signs in the prompt, as AI often struggles with accurate text generation.
4. The prompt must be entirely in English (preferably formatted as comma-separated tags instead of prose).
5. Append high-quality modifiers (e.g., masterpiece, best quality, high resolution, cinematic composition).
6. Output **only** the final English prompt text. Do NOT include any explanations, prefaces, or code block markers (```).
2. **You must clearly specify the body orientation and the exact gaze direction of each character (e.g., facing the camera, looking at the other person, staring at the window, back to the camera, etc.).**
3. You must integrate visual details from the Character and Setting Descriptions accurately into the scene.
4. Do not describe precise texts, lettering, or signs in the prompt, as AI often struggles with accurate text generation.
5. The prompt must be entirely in English (preferably formatted as comma-separated tags instead of prose).
6. Append high-quality modifiers (e.g., masterpiece, best quality, high resolution, cinematic composition).
7. Output **only** the final English prompt text. Do NOT include any explanations, prefaces, or code block markers (```).
aigc-director/aigc-claw/backend/prompts/reference/first_frame_zh.txt
@@ -11,8 +11,9 @@
【要求】
1. 提示词必须聚焦于这个片段的**视频首帧**画面。主要描述人物的相对位置、起始动作、整体环境结构和光影氛围。
2. 必须将相关人物的外貌特征和场地的空间细节融入到提示词中。
3. 不要包含具体的文字或符号描述,因为AI生成文字容易出错。
4. 语言必须是纯英文(以逗号分隔的标签形式呈现),不要出现任何中文。
5. 必须加上提升画面质量的提示词(例如:masterpiece, best quality, high resolution, cinematic composition等)。
6. 只需要输出最终的纯英文提示词文本,不要出现任何解释语、前缀或代码块标记(不要```)。
2. **必须明确规定每个角色的身体朝向以及目光看向的具体位置(例如:facing the camera, back to the camera, looking at the other person, staring at the window 等)。**
3. 必须将相关人物的外貌特征和场地的空间细节融入到提示词中。
4. 不要包含具体的文字或符号描述,因为AI生成文字容易出错。
5. 语言必须是纯英文(以逗号分隔的标签形式呈现),不要出现任何中文。
6. 必须加上提升画面质量的提示词(例如:masterpiece, best quality, high resolution, cinematic composition等)。
7. 只需要输出最终的纯英文提示词文本,不要出现任何解释语、前缀或代码块标记(不要```)。
aigc-director/aigc-claw/backend/prompts/script/meta_extract_zh.txt
@@ -12,7 +12,7 @@
【设计要求】
请从中【剧本输入】中提取以下信息,特别是构建【全局资产基调(核心角色与主场景)】。这些资产的外貌和布局将贯穿全剧保持不变。此外,请告诉我总共有多少集(幕)。
请从【剧本输入】中提取以下信息,特别是构建【全局资产基调(核心角色与主场景)】。这些资产的外貌和布局将贯穿全剧保持不变。此外,请根据剧本内容起一个合适的剧本标题(title)。
**注意(严格遵守):**
1. **输出格式**:必须且仅能输出一个纯净的 JSON 对象。严禁包含任何 Markdown 格式(如 ```json 代码块)、解释性文字、开场白或结尾。
@@ -33,6 +33,8 @@
【输出格式示例(仅返回此 JSON 对象)】
{{
  "title": "剧本名称",
  "logline": "一句话故事大纲",
  "genre": ["类型1", "类型2"],
  "mood": "影片情绪基调",
  "characters": [
    {{
aigc-director/references/workflow/create_character.md
@@ -66,7 +66,7 @@
收到此事件后,必须立即下载图片并发送给用户。
## 停点6:角色/场景设计完成,等待用户确认后继续下一阶段
## 停点3:角色/场景设计完成,等待用户确认后继续下一阶段
**必须向用户发送消息**,展示完整的角色和场景设计:
aigc-director/references/workflow/create_post.md
@@ -1,6 +1,6 @@
# 后期剪辑
执行第六阶段:将所有视频片段拼接成一个完整视频。
执行第六阶段:将所有视频片段按剧集分组拼接成完整的各集视频。
## 请求
@@ -18,15 +18,28 @@
```json
{
  "final_video": "code/result/video/xxx/final.mp4"
  "final_videos": [
    {
      "episode": 1,
      "path": "code/result/video/xxx/output/xxx_ep1.mp4",
      "name": "第 1 集"
    },
    {
      "episode": 2,
      "path": "code/result/video/xxx/output/xxx_ep2.mp4",
      "name": "第 2 集"
    }
  ],
  "final_video": "code/result/video/xxx/output/xxx_ep1.mp4"
}
```
## 完成提示
全部阶段完成后,告知用户:
- 完整视频已生成
- 各剧集的阶段视频已分别生成完毕
- **发送前端 URL**(获取本地 IPv4 地址,构造 `http://{local_ip}:3000/?session={session_id}&stage=post_production`)
- 提取所有的 `artifact.final_videos`,按集数依次**将生成的视频文件发送给用户**,并带上集数名称说明(如"第 1 集成片已生成")
- 提供 Web 界面链接供用户查看和下载
```bash
aigc-director/references/workflow/create_project.md
@@ -13,6 +13,7 @@
    "idea": "故事内容",
    "style": "anime",
    "video_ratio": "16:9",
    "episodes": 4,
    "llm_model": "qwen3.5-plus",
    "vlm_model": "qwen-vl-plus",
    "image_t2i_model": "doubao-seedream-5-0",
@@ -28,76 +29,69 @@
```json
{
  "session_id": "xxx",
  "status": "idle",
  "current_stage": "init"
  "status": "stage_completed",
  "params": {
    "idea": "故事内容",
    "style": "anime",
    "llm_model": "qwen3.5-plus",
    "vlm_model": "qwen-vl-plus",
    "episodes": 4
  }
}
```
---
## 参数说明
## 停点流程
| 参数 | 必填 | 说明 | 默认值 |
|------|------|------|--------|
| idea | ✅ | 故事创意/灵感 | - |
| style | ✅ | 视频风格 | realistic |
| video_ratio | | 视频比例 | 16:9 |
| llm_model | | 剧本生成模型 | qwen3.5-plus |
| vlm_model | | VLM 评估模型 | qwen-vl-plus |
| image_t2i_model | | 文生图模型 | doubao-seedream-5-0 |
| image_it2i_model | | 图生图模型 | doubao-seedream-5-0 |
| video_model | | 视频生成模型 | wan2.6-i2v-flash |
| enable_concurrency | | 开启并发生成 | true |
| web_search | | 联网搜索 | false |
本项目采用 **Agent 驱动的 6 阶段流水线**。系统在每一阶段完成后会进入 **停点 (Stop Event)**,等待用户确认后继续执行。
### 可用风格
`anime`, `realistic`, `comic-book`, `3d-disney`, `watercolor`, `oil-painting`, `cyberpunk`, `chinese-ink`
### 可选视频比例
6:9, 9:16, 1:1, 4:3, 3:4
### 可用模型
| 模块 | 模型 |
|------|------|
| LLM | qwen3.5-plus, deepseek-chat, gpt-4o, gemini-2.5-flash |
| VLM | qwen-vl-plus, gemini-2.5-flash-image |
| T2I | doubao-seedream-5-0, wan2.6-t2i, jimeng_t2i_v40 |
| I2I | doubao-seedream-5-0, wan2.6-image |
| Video | wan2.6-i2v-flash, kling-v3, jimeng_ti2v_v30_pro |
| 阶段 | 停点 ID | 阶段内部步骤 (Phase) | 说明 |
|------|---------|-----------------------|------|
| 1 | 2 | script_generation | 剧本生成:产出全剧本、人物设定、环境设定 |
| 2 | 3 | character_design | 角色/场景设计:为每个角色/场景生成参考图 |
| 3 | 4 | storyboard | 分镜设计:将剧本拆分为具体镜头 (segments) |
| 4 | 5 | reference_generation | 参考图生成:根据分镜生成首帧控制图 |
| 5 | 6 | video_generation | 视频生成:根据参考图生成动态视频片段 |
| 6 | - | post_production | 后期剪辑:按剧集拼接视频并生成最终成片 |
---
## 询问用户示例
## 全局监听:SSE 进度流
在创建项目前,请向用户展示以下选项并让用户选择:
启动项目后,**必须** 立即连接 SSE 端点以接收实时反馈:
表格形式:
| 配置项 | 选项 | 默认值(推荐) |
|--------|------|---------------|
| **视频风格 (style)** | anime, realistic, comic-book, 3d-disney, watercolor, oil-painting, cyberpunk, chinese-ink | realistic |
| **视频比例 (video_ratio)** | 16:9(横屏), 9:16(竖屏), 1:1(方形), 4:3, 3:4 | 16:9 |
| **LLM 模型** | qwen3.5-plus, deepseek-chat, gpt-4o, gemini-2.5-flash | qwen3.5-plus |
| **VLM 模型** | qwen-vl-plus, gemini-2.5-flash-image | qwen-vl-plus |
| **T2I 模型** | doubao-seedream-5-0, wan2.6-t2i, jimeng_t2i_v40 | doubao-seedream-5-0 |
| **I2I 模型** | doubao-seedream-5-0, wan2.6-image | doubao-seedream-5-0 |
| **Video 模型** | wan2.6-i2v-flash, kling-v3, jimeng_ti2v_v30_pro | wan2.6-i2v-flash |
| **联网搜索** | true, false | false |
| **并发生成** | true, false | true |
```bash
# 执行第一阶段并获取进度
curl -N "http://localhost:8000/api/project/{session_id}/execute/script_generation"
```
编号列表形式:
1. 故事创意 (idea): [用户的创意内容]
2. 视频风格 (style): realistic(默认值)
   - 可选:anime, realistic, comic-book, 3d-disney, watercolor, oil-painting, cyberpunk, chinese-ink
3. 视频比例 (video_ratio): 16:9(默认值)
   - 可选:16:9, 9:16, 1:1, 4:3, 3:4
4. LLM 模型: qwen3.5-plus(默认值)
SSE 每个事件为一行 JSON:
- `{"type": "progress", "percent": 10, "message": "正在生成剧本..."}`
- `{"type": "stage_complete", "stage": "script_generation", "requires_intervention": true}`
- `{"type": "error", "content": "..."}`
---
## 查看项目状态
随时可以查看当前剧本、分镜或视频的状态:
```bash
curl "http://localhost:8000/api/project/{session_id}/status"
```
---
## 下一步
跳转到 [1. 生成剧本 (script_generation)](create_script.md)。
5. LLM 模型: qwen3.5-plus(默认值)
   - 可选:qwen3.5-plus, deepseek-chat, gpt-4o, gemini-2.5-flash
5. VLM 模型: qwen-vl-plus(默认值)
6. VLM 模型: qwen-vl-plus(默认值)
   - 可选:qwen-vl-plus, gemini-2.5-flash-image
6. T2I 模型: doubao-seedream-5-0(默认值)
7. T2I 模型: doubao-seedream-5-0(默认值)
   - 可选:doubao-seedream-5-0, wan2.6-t2i, jimeng_t2i_v40
7. I2I 模型: doubao-seedream-5-0(默认值)
   - 可选:doubao-seedream-5-0, wan2.6-image
@@ -128,6 +122,7 @@
|--------|--------|
| 故事创意 (idea) | [用户的创意内容] |
| 视频风格 (style) | realistic(默认值)或其他用户选择 |
| 剧集数量 (episodes)| 4(默认值)或其他用户选择 |
| 视频比例 (video_ratio) | 16:9(默认值)或其他用户选择 |
| LLM 模型 | qwen3.5-plus(默认值)或其他用户选择 |
| VLM 模型 | qwen-vl-plus(默认值)或其他用户选择 |
aigc-director/references/workflow/create_reference.md
@@ -18,13 +18,13 @@
```json
{
  "shots": [
  "scenes": [
    {
      "scene_id": "1",
      "shot_id": "1",
      "id": "1-1",
      "description": "视觉提示词",
      "selected": "code/result/image/xxx/shot_001.png",
      "versions": [...],
      "visual_prompt": "优化后的视觉提示词"
      "versions": ["...", "..."],
      "status": "done"
    }
  ]
}
@@ -51,16 +51,16 @@
收到此事件后,必须立即下载图片并发送给用户。
## 停点8:参考图生成完成,等待用户确认后继续下一阶段
## 停点5:参考图生成完成,等待用户确认后继续下一阶段
**必须向用户发送消息**,展示每个分镜的参考图:
从 `artifact.shots[].selected` 获取每个分镜的参考图路径。
从 `artifact.scenes[].selected` 获取每个分镜的参考图路径。
**发送消息时必须**:
- 参考 [send_message/feishu.md](../send_message/feishu.md) 发送图片给用户
- 每张参考图需附带分镜编号和简短描述(如"场景1-分镜1:角色A在咖啡馆")
- 按场景顺序依次发送
- 每张参考图需附带分镜编号(如"场景1-分镜1:角色A在咖啡馆")
- 按分镜 ID 顺序依次发送
- **发送前端 URL**(获取本地 IPv4 地址,构造 `http://{local_ip}:3000/?session={session_id}&stage=reference_generation`)
- 发送完整列表后,询问用户确认
aigc-director/references/workflow/create_script.md
@@ -9,93 +9,41 @@
```bash
curl -X POST "http://localhost:8000/api/project/{session_id}/execute/script_generation" \
  -H "Content-Type: application/json" \
  -d '{"session_id": "xxx", "style": "anime"}'
  -d '{"session_id": "xxx", "style": "anime", "episodes": 4}'
```
---
## 停点流程
剧本生成阶段有 4 个停点:
现版本剧本生成阶段已精简,只有 1 个停点:
| 停点 | phase 值 | 操作 |
|------|----------|------|
| 1 | suggest_expand | 询问用户是否需要对情节进行扩写 |
| 2 | logline_selection | 让用户从 3 个情节候选中选择 |
| 3 | mode_selection | 让用户选择电影(4幕)或微电影(1幕) |
| 4 | script_generation | 等待剧本生成完成 |
| 2 | script_generation | 等待剧本生成完成,用户确认全集剧本 |
> **注意**:如果用户输入足够清晰完整丰富,`suggest_expand` 和 `logline_selection` 可能会直接跳过,直接进入 `mode_selection`。
## 处理停点
## 处理各停点
### 停点2:剧本生成完成,等待用户确认后继续下一阶段
### 停点2:建议扩写(suggest_expand)
此停点表示当前输入的情节过于简短,难以生成高质量剧情,系统建议进行创意扩写。
获取 artifact 查看生成的剧本内容:
```bash
# 获取 artifact 查看扩写建议
# 获取 artifact
curl "http://localhost:8000/api/project/{session_id}/artifact/script_generation"
```
从 `artifact.expand_suggestion` 或 `artifact.suggestion` 获取扩写建议,询问用户选择:
- **选择扩写**:调用 intervene,让系统进行创意扩写
- **跳过扩写**:直接进入下一停点(logline_selection 或 mode_selection)
```bash
# 选择扩写
curl -X POST "http://localhost:8000/api/project/{session_id}/intervene" \
  -H "Content-Type: application/json" \
  -d '{"stage": "script_generation", "modifications": {"expand_idea": true}}'
# 跳过扩写
curl -X POST "http://localhost:8000/api/project/{session_id}/intervene" \
  -H "Content-Type: application/json" \
  -d '{"stage": "script_generation", "modifications": {"expand_idea": false}}'
```
### 停点3:选择情节
```bash
# 获取 artifact 查看候选
curl "http://localhost:8000/api/project/{session_id}/artifact/script_generation"
```
从 `artifact.logline_options` 获取候选列表,询问用户选择,然后调用 intervene:
```bash
curl -X POST "http://localhost:8000/api/project/{session_id}/intervene" \
  -H "Content-Type: application/json" \
  -d '{"stage": "script_generation", "modifications": {"selected_logline": 0}}'
```
> **注意**:参数名是 `selected_logline`,不是 `selected_logline_index`!
### 停点4:选择模式
```bash
curl -X POST "http://localhost:8000/api/project/{session_id}/intervene" \
  -H "Content-Type: application/json" \
  -d '{"stage": "script_generation", "modifications": {"selected_mode": "expand"}}'
```
- `expand`: 电影模式(4幕,15-20分钟)
- `micro`: 微电影模式(1幕,3-5分钟)
### 停点5:剧本生成完成,等待用户确认后继续下一阶段
**必须向用户发送消息**,展示完整的剧本内容:
- **标题**:`artifact.title`
- **故事线**:`artifact.logline`
- **人物列表**:`artifact.characters`(包含人物名称、描述、性格特点)
- **背景列表**:`artifact.settings`(包含背景名称、描述、氛围)
- **场景列表**:`artifact.scenes`(包含场景编号、类型、描述、人物、地点)
- **故事梗概**:`artifact.logline`
- **人物列表**:`artifact.characters`(包含人物名称、描述、角色类型)
- **背景列表**:`artifact.settings`(包含背景名称、描述)
- **剧集列表**:`artifact.episodes`(包含各集的标题和内容)
- **发送前端 URL**(获取本地 IPv4 地址,构造 `http://{local_ip}:3000/?session={session_id}&stage=script_generation`)
询问用户确认后调用:
向用户展示剧本概览并询问确认后调用:
```bash
# 确认剧本,继续下一阶段
@@ -106,8 +54,8 @@
## SSE 事件监听
- `progress`: 实时进度,可能包含 `asset_complete`
- `stage_complete`: 阶段完成,检查 `data.phase` 确认是否还有下一阶段
- `progress`: 实时进度,可能包含进度百分比等信息
- `stage_complete`: 阶段完成
- `error`: 执行出错
---
@@ -116,11 +64,30 @@
```json
{
  "title": "标题",
  "logline": "核心故事线",
  "characters": [...],
  "settings": [...],
  "scenes": [...],
  "title": "剧本名称",
  "logline": "详细故事梗概",
  "characters": [
    {
      "name": "角色名",
      "character_id": "char_xxx",
      "description": "角色描述",
      "role": "主角"
    }
  ],
  "settings": [
    {
      "name": "场景名",
      "setting_id": "set_xxx",
      "description": "场景描述"
    }
  ],
  "episodes": [
    {
      "episode_number": 1,
      "act_title": "第一集标题",
      "content": "第一集的剧本正文内容"
    }
  ],
  "phase": "script_generation"
}
```
@@ -133,6 +100,5 @@
|------|------|----------|
| `curl: (7) Failed to connect` | 后端未运行 | 启动后端服务 |
| `404 Not Found` | session_id 错误或 API 路径错误 | 确认 session_id 正确 |
| SSE 无响应 | 后端任务卡住 | 检查日志 `/tmp/movie-backend.log` |
| 用户不选择 | 用户在停点未回复 | 等待用户选择,不要自行决定 |
| `"phase": "suggest_expand"` | 系统建议启用创意扩写 | 可自动调用 intervene 启用 |
| SSE 无响应 | 后端任务卡住 | 检查后端运行日志 |
| 用户不选择 | 用户仍在阅读剧本 | 耐心等待用户确认,不要自行决定点击下一步 |
aigc-director/references/workflow/create_storyboard.md
@@ -22,39 +22,43 @@
```json
{
  "shots": [
  "episodes": [
    {
      "scene_id": "1",
      "shot_id": "1",
      "duration": "5",
      "characters": ["角色A"],
      "location": "场景名",
      "description": "分镜描述",
      "visual_prompt": "视觉提示词"
      "episode_number": 1,
      "segments": [
        {
          "segment_id": "1-1",
          "scene_name": "场景名",
          "characters": ["角色A"],
          "plot": "分镜描述",
          "visual_prompt": "视觉提示词",
          "duration": 5,
          "setting_id": "set_xxx"
        }
      ]
    }
  ]
}
```
## 停点7:分镜设计完成,等待用户确认后继续下一阶段
## 停点4:分镜设计完成,等待用户确认后继续下一阶段
**必须向用户发送消息**,展示完整的分镜列表:
从 `artifact.shots` 获取所有分镜数据,用表格形式展示:
按剧集和分镜顺序展示:
| 场景-分镜 | 时长 | 人物 | 地点 | 情节描述 |
|-----------|------|------|------|----------|
| 1-1 | 5s | 角色A, 角色B | 咖啡馆 | 两人在咖啡馆交谈 |
| 1-2 | 3s | 角色A | 咖啡馆 | 角色A望向窗外 |
| 剧集 | 分镜ID | 时长 | 人物 | 地点 | 情节描述 |
|------|--------|------|------|------|----------|
| 第1集 | 1-1 | 5s | 角色A | 咖啡馆 | 两人在咖啡馆交谈 |
**发送消息时必须**:
- 使用文字形式发送表格(参考 [send_message/feishu.md](../send_message/feishu.md))
- 包含总时长统计
- 包含按剧集统计的时长
- **发送前端 URL**(获取本地 IPv4 地址,构造 `http://{local_ip}:3000/?session={session_id}&stage=storyboard`)
- 发送完整列表后,询问用户确认
询问内容示例:
> "分镜设计已完成,共 X 个分镜,总时长约 Y 秒。请确认是否继续生成参考图?"
> "分镜设计已完成,共生成 X 集,总时长约 Y 秒。请确认是否继续生成参考图?"
## 继续下一阶段
aigc-director/references/workflow/create_video.md
@@ -20,12 +20,12 @@
{
  "clips": [
    {
      "scene_id": "1",
      "shot_id": "1",
      "id": "1-1",
      "description": "视频描述",
      "selected": "code/result/video/xxx/clip_001.mp4",
      "versions": [...],
      "status": "done|failed"
      "versions": ["...", "..."],
      "duration": 5,
      "status": "done"
    }
  ]
}
@@ -52,7 +52,7 @@
收到此事件后,必须立即下载视频并发送给用户。
## 停点9:视频片段生成完成,等待用户确认后继续下一阶段
## 停点6:视频片段生成完成,等待用户确认后继续下一阶段
**必须向用户发送消息**,展示每个视频片段:
@@ -60,14 +60,14 @@
**发送消息时必须**:
- 参考 [send_message/feishu.md](../send_message/feishu.md) 发送视频给用户
- 每个视频片段需附带分镜编号和描述(如"场景1-分镜1:角色A走进咖啡馆")
- 每个视频片段需附带分镜编号(如"分镜1-1:角色A走进咖啡馆")
- 标注视频时长和状态(done/failed)
- 按场景顺序依次发送
- 按分镜 ID 顺序依次发送
- **发送前端 URL**(获取本地 IPv4 地址,构造 `http://{local_ip}:3000/?session={session_id}&stage=video_generation`)
- 发送完整列表后,询问用户确认
询问内容示例:
> "视频片段生成完成,共 X 个片段,Y 个成功。请确认是否继续进行后期剪辑?"
> "视频片段生成完成,共 X 个片段。请确认是否继续进行后期剪辑?"
## 继续下一阶段