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
  }
}
```
@@ -89,15 +93,11 @@
**请求体**:
```json
{
  "session_id": "1773208355389",
  "style": "anime",
  "llm_model": "deepseek-chat",
  "vlm_model": "qwen3.5-plus",
  "image_t2i_model": "jimeng_t2i_v40",
  "image_it2i_model": "jimeng_t2i_v40",
  "video_model": "wan2.6-i2v-flash"
  "style": "anime"
}
```
> 请求体参数与创建项目相同(可选),会覆盖项目中已有的对应参数。
**响应**: SSE 流式返回,包含以下事件类型:
- `progress`: 进度更新
@@ -163,11 +163,11 @@
{
  "stage": "script_generation",
  "artifact": {
    "title": "影弑",
    "title": "剧本名称",
    "logline": "...",
    "characters": [...],
    "settings": [...],
    "scenes": [...]
    "episodes": [...]
  }
}
```
@@ -176,15 +176,48 @@
### 5. 更新阶段产物
更新指定阶段的产物数据(如用户选择)。
更新指定阶段的产物数据(如用户修改提示词、选择版本)。
**接口**: `PATCH /api/project/{session_id}/artifact/{stage}`
**请求体**:
请求体格式**因阶段而异**:
#### storyboard — 修改分镜(时长/剧情/视觉提示词)
```json
{
  "selected_logline": "选中的logan",
  "scenes": [...]
  "shots": [
    {"shot_id": "shot_001_01", "duration": 5, "plot": "新剧情描述", "visual_prompt": "新视觉提示词"}
  ]
}
```
#### reference_generation — 修改视觉提示词
```json
{
  "shots": [
    {"shot_id": "shot_001_01", "visual_prompt": "新提示词"}
  ]
}
```
#### reference_generation — 选择参考图版本
```json
{
  "shot_001_01": "code/result/image/xxx/shot_001_01_v2.jpg"
}
```
#### video_generation — 修改片段描述/时长
```json
{
  "shot_001_01": {"description": "新描述", "duration": 5}
}
```
#### video_generation — 选择视频版本
```json
{
  "shot_001_01": "code/result/video/xxx/shot_001_01_v2.mp4"
}
```
@@ -194,21 +227,27 @@
### 6. 干预阶段
对已完成的阶段进行修改并重新执行。
对已完成的阶段进行修改并重新执行(重新生成部分产物)。
**接口**: `POST /api/project/{session_id}/intervene`
**请求体**:
```json
{
  "stage": "script_generation",
  "stage": "reference_generation",
  "modifications": {
    "modified_script": "修改后的剧本内容"
    "regenerate_scenes": ["shot_001_01", "shot_001_02"]
  }
}
```
**响应**: SSE 流式返回,同执行阶段。
- `stage`:要干预的阶段
- `modifications`:修改内容,目前支持 `regenerate_scenes`(要重新生成的镜头 ID 列表)
**响应**: SSE 流式返回,包含以下事件类型:
- `progress`: 进度更新
- `stage_complete`: 阶段完成
- `error`: 执行错误
---
@@ -306,10 +345,7 @@
# 2. 执行第一阶段(剧本生成)- 监听 SSE
curl -X POST "http://localhost:8000/api/project/${SESSION_ID}/execute/script_generation" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "'$SESSION_ID'",
    "style": "anime"
  }'
  -d '{"style": "anime"}'
# 3. 获取剧本产物
curl -s "http://localhost:8000/api/project/${SESSION_ID}/artifact/script_generation"
@@ -320,7 +356,7 @@
# 5. 执行第二阶段(角色设计)
curl -X POST "http://localhost:8000/api/project/${SESSION_ID}/execute/character_design" \
  -H "Content-Type: application/json" \
  -d '{"session_id": "'$SESSION_ID'", "style": "anime"}'
  -d '{"style": "anime"}'
# 6. 确认并继续
curl -s -X POST "http://localhost:8000/api/project/${SESSION_ID}/continue"
@@ -328,7 +364,7 @@
# 7. 执行第三阶段(分镜设计)
curl -X POST "http://localhost:8000/api/project/${SESSION_ID}/execute/storyboard" \
  -H "Content-Type: application/json" \
  -d '{"session_id": "'$SESSION_ID'", "style": "anime"}'
  -d '{"style": "anime"}'
# 8. 确认并继续
curl -s -X POST "http://localhost:8000/api/project/${SESSION_ID}/continue"
@@ -336,7 +372,7 @@
# 9. 执行第四阶段(参考图生成)
curl -X POST "http://localhost:8000/api/project/${SESSION_ID}/execute/reference_generation" \
  -H "Content-Type: application/json" \
  -d '{"session_id": "'$SESSION_ID'", "style": "anime"}'
  -d '{"style": "anime"}'
# 10. 确认并继续
curl -s -X POST "http://localhost:8000/api/project/${SESSION_ID}/continue"
@@ -344,7 +380,7 @@
# 11. 执行第五阶段(视频生成)
curl -X POST "http://localhost:8000/api/project/${SESSION_ID}/execute/video_generation" \
  -H "Content-Type: application/json" \
  -d '{"session_id": "'$SESSION_ID'", "style": "anime"}'
  -d '{"style": "anime"}'
# 12. 确认并继续
curl -s -X POST "http://localhost:8000/api/project/${SESSION_ID}/continue"
@@ -352,7 +388,7 @@
# 13. 执行第六阶段(后期剪辑)
curl -X POST "http://localhost:8000/api/project/${SESSION_ID}/execute/post_production" \
  -H "Content-Type: application/json" \
  -d '{"session_id": "'$SESSION_ID'", "style": "anime"}'
  -d '{"style": "anime"}'
```
### 使用 jq 简化