{
  "format": "mosael-workflow",
  "version": 1,
  "workflow_revision": 1,
  "name": "漫剧单集",
  "description": "拍漫剧(短剧)的一集:和「从主题到完整视频」同一条流水线 —— 认资产库里的角色和场景、分镜、3D 白模机位、逐镜关键帧 ——但剧本和分镜按**对白推动**来写(旁白只交代时间地点),对白镜头对着说话的人;**角色的台词由视频模型出片时一起念出来**,语气跟着这一镜的表情和情绪走(需要 MiniMax H3 这类会出原生人声的视频模型),旁白另配。主题里可以直接贴一份逐镜剧本(画面、谁说、台词)。先用「连续剧 · 系列设定」把角色和场景建进库,再一集一集拍。花费量级:同「从主题到完整视频」。这一份带着「用角色的嗓子演这一句」(对白模型,收首帧和参考音频,例:ComfyUI 范例「H3 对白 · 角色嗓音」):导入后在那一格挑好模型,同一个角色几镜之间嗓音一致。没有这种模型的话,删掉「说话的角色带着嗓子吗」「用这个角色的嗓子念一句参考」「用角色的嗓子演这一句」三个节点,对白照旧按文字描述念。应用里有这种模型才带这一支。",
  "graph_hash": "8d4c61124eb05df7b73438942ab1631105874cdc7585ce10df09d0ee668ecf7c",
  "graph": {
    "meta": {
      "template_id": "drama_episode",
      "template_version": 8,
      "source": "official"
    },
    "nodes": [
      {
        "id": "start",
        "type": "start",
        "name": "填写视频主题",
        "position": {
          "x": 40,
          "y": 300
        },
        "config": {
          "params": {
            "topic": "",
            "target_duration_seconds": 30,
            "shot_seconds": 5,
            "max_shots": 8,
            "audience": "对该主题感兴趣的大众观众",
            "tone": "专业、清晰、克制且有电影感",
            "language": "简体中文",
            "aspect_ratio": "16:9",
            "resolution": "720p",
            "fps": 24,
            "voice_id": ""
          },
          "required_params": [
            "topic"
          ]
        }
      },
      {
        "id": "frame_plan",
        "type": "json_extract",
        "name": "按画幅取尺寸",
        "position": {
          "x": 340,
          "y": -120
        },
        "config": {
          "source": "{\"16:9\": {\"frame_size\": \"\", \"video_size\": \"\", \"width\": 1920, \"height\": 1080}, \"9:16\": {\"frame_size\": \"\", \"video_size\": \"\", \"width\": 1080, \"height\": 1920}, \"1:1\": {\"frame_size\": \"\", \"video_size\": \"\", \"width\": 1080, \"height\": 1080}}",
          "path": "{{start.aspect_ratio}}"
        }
      },
      {
        "id": "creative_brief",
        "type": "llm",
        "name": "提炼核心主旨与创意简报",
        "position": {
          "x": 340,
          "y": 300
        },
        "config": {
          "profile_id": "",
          "model": "",
          "preset": "precise",
          "system": "你是资深创意总监和纪录片策划。先把用户给出的主题收敛为全片唯一核心主旨，\n建立清晰的受众收益、叙事因果和可执行视觉母题。不要编造未经输入支持的具体数字、引语、人物经历\n或研究结论；需要核实的内容写入 factual_boundaries。只输出符合 JSON Schema 的对象。",
          "prompt": "主题：{{start.topic}}\n目标时长：{{start.target_duration_seconds}} 秒\n目标观众：{{start.audience}}\n表达气质：{{start.tone}}\n成片语言：{{start.language}}\n\n请形成可直接供导演执行的创意简报。核心主旨只能有一个；若主题过宽，主动选择最有叙事张力且\n不需要虚构事实的角度。",
          "response_format": "json_schema",
          "json_schema_name": "professional_video_creative_brief",
          "json_schema": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "准确、有记忆点且不过度承诺的视频标题"
              },
              "core_thesis": {
                "type": "string",
                "description": "全片唯一核心主旨，一句话可复述"
              },
              "audience_takeaway": {
                "type": "string",
                "description": "观众看完应理解、感受或采取的行动"
              },
              "opening_hook": {
                "type": "string",
                "description": "前五秒建立问题和观看理由的钩子"
              },
              "narrative_arc": {
                "type": "string",
                "description": "开场、展开、转折、收束的因果弧线"
              },
              "visual_concept": {
                "type": "string",
                "description": "贯穿全片的视觉母题与场景逻辑"
              },
              "tone": {
                "type": "string"
              },
              "factual_boundaries": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "不得凭空断言、需要用户复核的事实边界"
              }
            },
            "required": [
              "title",
              "core_thesis",
              "audience_takeaway",
              "opening_hook",
              "narrative_arc",
              "visual_concept",
              "tone",
              "factual_boundaries"
            ],
            "additionalProperties": false
          },
          "json_schema_strict": "true",
          "temperature": 0.3,
          "max_tokens": 2400
        }
      },
      {
        "id": "narrative_script",
        "type": "llm",
        "name": "编写叙事脚本与时间节拍",
        "position": {
          "x": 680,
          "y": 80
        },
        "config": {
          "profile_id": "",
          "model": "",
          "preset": "precise",
          "system": "你是资深编剧和旁白导演。围绕唯一核心主旨规划完整叙事，不引入创意简报之外\n的事实。按目标时长拆成首尾连续的叙事节拍：开头尽快建立观看理由，中段用因果而不是信息堆砌推进，\n结尾回收主旨。口播要自然、可说、符合指定语言。只输出符合 JSON Schema 的对象。\n**这是一部漫剧(短剧),不是解说片。** 故事靠角色的对白和表演推进:每一拍尽量由某个角色说出来或演出来,台词口语化、\n带情绪和潜台词;旁白只在必要时交代时间、地点、前情,全片不超过三成。一句台词一个人说,念出来不超过 {{start.shot_seconds}} 秒。",
          "prompt": "创意简报：\n{{creative_brief.text}}\n\n用户给的原始主题(原文)：\n{{start.topic}}\n\n目标时长：{{start.target_duration_seconds}} 秒\n成片语言：{{start.language}}\n请输出完整口播，并把叙事拆成按时间连续的 beats。每个 beat 必须有明确叙事任务。\n如果用户的原始主题里已经写好了逐镜的分场剧本(一条一镜:画面、谁说话、台词),就**严格照它**:镜数、顺序、每一镜的台词逐字照抄、说话人照写,不增、不减、不改写、不合并;其余要你补的(机位、表演、光线、提示词)按它的画面去补。没给剧本时按创意简报自己写。",
          "response_format": "json_schema",
          "json_schema_name": "professional_video_narrative_script",
          "json_schema": {
            "type": "object",
            "properties": {
              "opening_hook": {
                "type": "string"
              },
              "narrative_arc": {
                "type": "string"
              },
              "full_narration": {
                "type": "string"
              },
              "beats": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "beat_number": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "start_seconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "end_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "objective": {
                      "type": "string",
                      "description": "这一段对主旨推进的唯一任务"
                    },
                    "narration": {
                      "type": "string",
                      "description": "该时间段的完整口播或对白"
                    }
                  },
                  "required": [
                    "beat_number",
                    "start_seconds",
                    "end_seconds",
                    "objective",
                    "narration"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "opening_hook",
              "narrative_arc",
              "full_narration",
              "beats"
            ],
            "additionalProperties": false
          },
          "json_schema_strict": "true",
          "temperature": 0.4,
          "max_tokens": 5000
        }
      },
      {
        "id": "library_characters",
        "type": "entity_list",
        "name": "看看资产库里有哪些人物",
        "position": {
          "x": 340,
          "y": 620
        },
        "config": {
          "kind": "character"
        }
      },
      {
        "id": "library_locations",
        "type": "entity_list",
        "name": "看看资产库里有哪些场景",
        "position": {
          "x": 340,
          "y": 780
        },
        "config": {
          "kind": "location"
        }
      },
      {
        "id": "visual_bible",
        "type": "llm",
        "name": "定角色、场景与视觉圣经",
        "position": {
          "x": 680,
          "y": 520
        },
        "config": {
          "profile_id": "",
          "model": "",
          "preset": "creative",
          "system": "你是摄影指导、美术指导、角色设计和连续性监制。根据创意简报建立全片共享的视觉圣经：\n主体、环境、光线、色彩、镜头语言与连续性规则，规则要具体到生成模型可以复用，避免空泛风格词。\n同时定下**出镜角色**(最多 4 个；appearance 用英文写到能画出三视图的程度：年龄、脸型发型、服装与配色、\n体型、标志性道具)和**场景**(最多 3 个；description 用英文写空间、陈设、材质与光源，给出大致的\n长宽高)。每个角色分一个不同的白模颜色，并在 blockout_legend 里用英文说明颜色与角色的对应。\nstyle_prompt 是一句英文画风，全片每张图、每段视频都会带上。不得要求画面生成字幕、UI、Logo 或水印。\n用户会给出资产库里已有的人物和场景：故事需要的角色或场景**就是**其中某一个时，name 一字不差地沿用它的名字，\nappearance / description 照它的提示词描述写（它的参考图会直接拿来用，不再重画）；只是相像、并不是同一个的不要硬套，\n新建一个名字不同的。清单为空就全部新建。\n只输出符合 JSON Schema 的对象。",
          "prompt": "创意简报：\n{{creative_brief.text}}\n\n画幅：{{start.aspect_ratio}}；表达气质：{{start.tone}}。\n请建立整条视频共享的视觉圣经、摄影语言和跨镜头连续性规则，并定下出镜角色与场景。\n\n资产库里已有的人物（名字 — 提示词描述；空着就是还没有）：\n{{library_characters.text}}\n\n资产库里已有的场景：\n{{library_locations.text}}",
          "response_format": "json_schema",
          "json_schema_name": "professional_video_visual_bible",
          "json_schema": {
            "type": "object",
            "properties": {
              "subject_bible": {
                "type": "string",
                "description": "人物或主体跨镜头保持一致的外观与行为"
              },
              "environment_bible": {
                "type": "string",
                "description": "空间、时代、材质与关键道具约束"
              },
              "camera_language": {
                "type": "string",
                "description": "景别、焦段、机位与运镜的统一语法"
              },
              "lighting_plan": {
                "type": "string"
              },
              "color_palette": {
                "type": "string"
              },
              "continuity_rules": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "global_negative_prompt": {
                "type": "string"
              },
              "characters": {
                "type": "array",
                "maxItems": 4,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{0,30}$",
                      "description": "英文小写短 id,如 hero"
                    },
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "description": "在故事里是谁"
                    },
                    "appearance": {
                      "type": "string",
                      "description": "英文,交给图像模型画三视图:年龄、脸型发型、服装与配色、体型与身高、标志性道具"
                    },
                    "height_m": {
                      "type": "number",
                      "minimum": 0.5,
                      "maximum": 2.5
                    },
                    "blockout_color": {
                      "type": "string",
                      "enum": [
                        "#d9534f",
                        "#4a7fd6",
                        "#5cb85c",
                        "#e0a030"
                      ],
                      "description": "白模里这个人偶的颜色,每个角色不同"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "role",
                    "appearance",
                    "height_m",
                    "blockout_color"
                  ],
                  "additionalProperties": false
                },
                "description": "出镜的角色(最多 4 个);纯物件/风景的片子可以为空"
              },
              "locations": {
                "type": "array",
                "maxItems": 3,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9-]{0,30}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string",
                      "description": "英文,交给图像模型画场景设定图:空间、时代、材质、关键陈设、光源"
                    },
                    "width_m": {
                      "type": "number",
                      "minimum": 2,
                      "maximum": 60
                    },
                    "depth_m": {
                      "type": "number",
                      "minimum": 2,
                      "maximum": 60
                    },
                    "height_m": {
                      "type": "number",
                      "minimum": 2,
                      "maximum": 20
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "description",
                    "width_m",
                    "depth_m",
                    "height_m"
                  ],
                  "additionalProperties": false
                },
                "description": "全片用到的场景(最多 3 个)"
              },
              "style_prompt": {
                "type": "string",
                "description": "英文一句话的全片画风,每张图、每段视频都会带上"
              },
              "blockout_legend": {
                "type": "string",
                "description": "英文,白模里各颜色分别是谁,只写「颜色 = 名字(一句身份)」,如 'red = Lin (class president), blue = Kai';不要写 mannequin / figure 这类词(照字面画的模型会把它们画出来)"
              }
            },
            "required": [
              "subject_bible",
              "environment_bible",
              "camera_language",
              "lighting_plan",
              "color_palette",
              "continuity_rules",
              "global_negative_prompt",
              "characters",
              "locations",
              "style_prompt",
              "blockout_legend"
            ],
            "additionalProperties": false
          },
          "json_schema_strict": "true",
          "temperature": 0.55,
          "max_tokens": 5000
        }
      },
      {
        "id": "video_project",
        "type": "project_sequence_create",
        "name": "建立成片项目与时间线",
        "position": {
          "x": 1040,
          "y": -120
        },
        "config": {
          "name": "{{creative_brief.json.title}} · 自动成片",
          "width": "{{frame_plan.value.width}}",
          "height": "{{frame_plan.value.height}}",
          "fps": "{{start.fps}}"
        }
      },
      {
        "id": "character_sheets",
        "type": "loop_foreach",
        "name": "每个角色:库里有就用,没有就画三视图",
        "position": {
          "x": 1400,
          "y": 620
        },
        "config": {
          "items": "{{visual_bible.json.characters}}",
          "inputs": {
            "style": "{{visual_bible.json.style_prompt}}",
            "project_id": "{{video_project.project_id}}"
          },
          "body": {
            "nodes": [
              {
                "id": "find",
                "type": "entity_get",
                "name": "在资产库里找这个角色",
                "position": {
                  "x": 80,
                  "y": 140
                },
                "config": {
                  "kind": "character",
                  "name": "{{loop.item.name}}",
                  "limit": 1
                }
              },
              {
                "id": "has_art",
                "type": "condition",
                "name": "库里有它的图吗",
                "position": {
                  "x": 380,
                  "y": 140
                },
                "config": {
                  "left": "{{find.asset_ids.0}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "sheet",
                "type": "ai_generate",
                "name": "画这个角色的三视图",
                "config": {
                  "provider": "",
                  "provider_profile_id": "",
                  "model": "",
                  "kind": "image",
                  "prompt": "Character turnaround reference sheet for {{loop.item.name}}: {{loop.item.appearance}}. Three full-body views of the same character side by side — front, side profile, back — identical outfit and proportions, relaxed A-pose, plain white background, soft even studio light, no text, no labels, no borders. {{input.style}}",
                  "parameters": {}
                },
                "position": {
                  "x": 680,
                  "y": 240
                }
              },
              {
                "id": "save",
                "type": "entity_save",
                "name": "存成人物资产",
                "config": {
                  "kind": "character",
                  "name": "{{loop.item.name}}",
                  "prompt": "{{loop.item.appearance}}",
                  "description": "{{loop.item.role}}",
                  "asset_ids": "",
                  "role": "turnaround"
                },
                "position": {
                  "x": 980,
                  "y": 240
                },
                "inputs": [
                  "asset_ids"
                ]
              },
              {
                "id": "views",
                "type": "entity_sheet_views",
                "name": "拆成单张视图",
                "position": {
                  "x": 1280,
                  "y": 140
                },
                "config": {
                  "kind": "character",
                  "name": "{{loop.item.name}}"
                }
              },
              {
                "id": "file_art",
                "type": "asset_update",
                "name": "归档进成片项目",
                "position": {
                  "x": 980,
                  "y": 400
                },
                "config": {
                  "asset_ids": "",
                  "project_id": "{{input.project_id}}"
                },
                "inputs": [
                  "asset_ids"
                ]
              }
            ],
            "edges": [
              {
                "id": "find_check",
                "source": "find",
                "target": "has_art"
              },
              {
                "id": "missing_draw",
                "source": "has_art",
                "target": "sheet",
                "source_handle": "false"
              },
              {
                "id": "draw_save",
                "source": "sheet",
                "target": "save"
              },
              {
                "id": "draw_file",
                "source": "sheet",
                "target": "file_art"
              },
              {
                "id": "found_views",
                "source": "has_art",
                "target": "views",
                "source_handle": "true"
              },
              {
                "id": "saved_views",
                "source": "save",
                "target": "views"
              },
              {
                "id": "d-sheet-asset_id-save-asset_ids",
                "source": "sheet",
                "target": "save",
                "kind": "data",
                "source_output": "asset_id",
                "target_input": "asset_ids"
              },
              {
                "id": "d-sheet-asset_id-file_art-asset_ids",
                "source": "sheet",
                "target": "file_art",
                "kind": "data",
                "source_output": "asset_id",
                "target_input": "asset_ids"
              }
            ]
          },
          "output": "{{views.asset_ids.0}}:reference_image\n{{views.asset_ids.1}}:reference_image\n{{views.asset_ids.2}}:reference_image\n{{views.asset_ids.3}}:reference_image",
          "concurrency": 3
        }
      },
      {
        "id": "location_art",
        "type": "loop_foreach",
        "name": "每个场景:库里有就用,没有就画设定图",
        "position": {
          "x": 1400,
          "y": 820
        },
        "config": {
          "items": "{{visual_bible.json.locations}}",
          "inputs": {
            "style": "{{visual_bible.json.style_prompt}}",
            "project_id": "{{video_project.project_id}}"
          },
          "body": {
            "nodes": [
              {
                "id": "find",
                "type": "entity_get",
                "name": "在资产库里找这个场景",
                "position": {
                  "x": 80,
                  "y": 140
                },
                "config": {
                  "kind": "location",
                  "name": "{{loop.item.name}}",
                  "limit": 1,
                  "role": "design_sheet"
                }
              },
              {
                "id": "has_art",
                "type": "condition",
                "name": "库里有它的图吗",
                "position": {
                  "x": 380,
                  "y": 140
                },
                "config": {
                  "left": "{{find.asset_ids.0}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "art",
                "type": "ai_generate",
                "name": "画这个场景的设计稿",
                "config": {
                  "provider": "",
                  "provider_profile_id": "",
                  "model": "",
                  "kind": "image",
                  "prompt": "Location design sheet of {{loop.item.name}}: {{loop.item.description}} A 2x2 grid of four separate panels with thin white gutters on a plain light background: top-left a high bird's-eye view showing the whole layout of the place; top-right an eye-level view looking the opposite way; bottom-left a close-up of the walls, doors, windows and fixtures; bottom-right a close-up of the floor or ground and small props. The same place, materials, lighting and weather in every panel. No people, no text. {{input.style}}",
                  "parameters": {}
                },
                "position": {
                  "x": 680,
                  "y": 240
                }
              },
              {
                "id": "save",
                "type": "entity_save",
                "name": "存成场景资产",
                "config": {
                  "kind": "location",
                  "name": "{{loop.item.name}}",
                  "prompt": "{{loop.item.description}}",
                  "asset_ids": "",
                  "role": "design_sheet"
                },
                "position": {
                  "x": 980,
                  "y": 240
                },
                "inputs": [
                  "asset_ids"
                ]
              },
              {
                "id": "views",
                "type": "entity_sheet_views",
                "name": "拆成单张视图",
                "position": {
                  "x": 1280,
                  "y": 140
                },
                "config": {
                  "kind": "location",
                  "name": "{{loop.item.name}}"
                }
              },
              {
                "id": "file_art",
                "type": "asset_update",
                "name": "归档进成片项目",
                "position": {
                  "x": 980,
                  "y": 400
                },
                "config": {
                  "asset_ids": "",
                  "project_id": "{{input.project_id}}"
                },
                "inputs": [
                  "asset_ids"
                ]
              }
            ],
            "edges": [
              {
                "id": "find_check",
                "source": "find",
                "target": "has_art"
              },
              {
                "id": "missing_draw",
                "source": "has_art",
                "target": "art",
                "source_handle": "false"
              },
              {
                "id": "draw_save",
                "source": "art",
                "target": "save"
              },
              {
                "id": "draw_file",
                "source": "art",
                "target": "file_art"
              },
              {
                "id": "found_views",
                "source": "has_art",
                "target": "views",
                "source_handle": "true"
              },
              {
                "id": "saved_views",
                "source": "save",
                "target": "views"
              },
              {
                "id": "d-art-asset_id-save-asset_ids",
                "source": "art",
                "target": "save",
                "kind": "data",
                "source_output": "asset_id",
                "target_input": "asset_ids"
              },
              {
                "id": "d-art-asset_id-file_art-asset_ids",
                "source": "art",
                "target": "file_art",
                "kind": "data",
                "source_output": "asset_id",
                "target_input": "asset_ids"
              }
            ]
          },
          "output": "{{views.asset_ids.0}}:reference_image\n{{views.asset_ids.1}}:reference_image\n{{views.asset_ids.2}}:reference_image\n{{views.asset_ids.3}}:reference_image",
          "concurrency": 3
        }
      },
      {
        "id": "storyboard",
        "type": "llm",
        "name": "按时间拆解分镜与机位",
        "position": {
          "x": 1040,
          "y": 140
        },
        "config": {
          "profile_id": "",
          "model": "",
          "preset": "creative",
          "system": "你是导演、摄影指导、分镜师和生成提示词工程师。把创意简报拆成连续的\n{{start.shot_seconds}} 秒镜头。每镜给出精确起止时间、口播、场景(location_id,以及它的 name 写进 location_name)、出镜角色(首帧里最主要的那个的 name 写进 first_frame_subject)、人物站位与走位、景别、\n机位角度、焦段(lens_mm)、运镜方式与路径、主体动作、光线、声音设计和连续性。所有镜头时间必须\n首尾相接，不重叠、不留空；首镜建立钩子，中段逐步升级信息，末镜完成主旨回收。每镜 narration 念出来\n不得超过 {{start.shot_seconds}} 秒：中文按每秒约 4 字、英文按每秒约 2.5 个词估算，宁短勿长；超出的部分会被加速压进\n这一镜，听起来会很赶。narration 可以是旁白，也可以是某个角色的台词：**一镜只写一个人说的话**，speaker 写说话的\n角色在视觉圣经里的 name(一字不差，配音按它找这个角色的嗓子)，旁白写空字符串；两人对话就拆成几镜，一镜一句(正反打)。\n\n每镜选一条出片路径(reference_mode,可选:keyframes):keyframes 先按白模机位画首帧再生成,\n构图最稳,适合绝大多数镜头;references 把角色三视图、场景设定图和白模运镜视频直接交给视频模型,\n适合环绕、长距离跟拍这类首尾两帧说不清的复杂运镜。first_frame_prompt 用英文完整描述第一帧画面。\ngeneration_prompt 用英文写动作节拍、表演、环境变化与光影，主体动作必须能在 {{start.shot_seconds}} 秒内完成；\n**不要写机位参数**(机位会从白模自动算出来补上),画面中不要生成字幕、UI、Logo 或水印。\ntransition_in/out 是交付给后期查看的剪辑意图；本工作流自动合成阶段按时间顺序硬切。只输出符合\nJSON Schema 的对象。\n\n**漫剧镜头规则**:有角色台词的镜头,镜头对着说话的人 —— 中近景或近景,正面或 3/4 侧面,脸和嘴看得清;reference_mode\n一律 keyframes,first_frame_subject 写说话的那个角色;generation_prompt 用英文写清这一句的表情、眼神、手势和情绪变化\n(视频模型出片时照这一句的情绪把台词念出来,嘴型跟着念;台词本身不用抄进 generation_prompt,模板会拼上)。\n没有角色台词的镜头,generation_prompt 末尾写 \"No one speaks.\"(旁白另配,画里的人不出声)。两人对话用正反打交替;\n旁白镜头不超过三成,用来交代环境或转场;动作镜头写清动作节拍。",
          "prompt": "请把叙事脚本与视觉圣经合并成可直接生成的专业时间分镜。\n\n用户给的原始主题(原文)：\n{{start.topic}}\n\n如果用户的原始主题里已经写好了逐镜的分场剧本(一条一镜:画面、谁说话、台词),就**严格照它**:镜数、顺序、每一镜的台词逐字照抄、说话人照写,不增、不减、不改写、不合并;其余要你补的(机位、表演、光线、提示词)按它的画面去补。没给剧本时按创意简报自己写。\n\n创意简报：\n{{creative_brief.text}}\n\n叙事脚本与节拍：\n{{narrative_script.text}}\n\n视觉圣经(含角色与场景 id)：\n{{visual_bible.text}}\n\n成片目标时长：{{start.target_duration_seconds}} 秒；画幅：{{start.aspect_ratio}}；\n语言：{{start.language}}。每个镜头固定 {{start.shot_seconds}} 秒。镜头数 = 目标时长 ÷ {{start.shot_seconds}} 向上取整，\n但**最多 {{start.max_shots}} 镜**；两者冲突时以上限为准，把成片做短一点，\n**不要**为了凑满时长而缩短单镜时长——单镜时长是固定的 {{start.shot_seconds}} 秒。时间码从 0 开始连续编号。",
          "response_format": "json_schema",
          "json_schema_name": "professional_timed_storyboard",
          "json_schema": {
            "type": "object",
            "properties": {
              "total_duration_seconds": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "timeline_summary": {
                "type": "string"
              },
              "continuity_bible": {
                "type": "string",
                "description": "所有镜头共享的人物、场景、风格连续性约束"
              },
              "shots": {
                "type": "array",
                "minItems": 1,
                "maxItems": 24,
                "items": {
                  "type": "object",
                  "properties": {
                    "shot_number": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "start_seconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "end_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "duration_seconds": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "story_beat": {
                      "type": "string",
                      "description": "该镜头推进叙事的唯一任务"
                    },
                    "narration": {
                      "type": "string",
                      "description": "该时间段的口播或对白，只写一个人说的话，念出来不超过 {{start.shot_seconds}} 秒；无则写空字符串"
                    },
                    "speaker": {
                      "type": "string",
                      "description": "说这句 narration 的角色：视觉圣经里这个角色的 name，一字不差；旁白或没有人说话写空字符串"
                    },
                    "location_id": {
                      "type": "string",
                      "description": "视觉圣经里的场景 id"
                    },
                    "location_name": {
                      "type": "string",
                      "description": "这一镜的场景在视觉圣经里的 name,一字不差"
                    },
                    "first_frame_subject": {
                      "type": "string",
                      "description": "首帧里最主要的那个角色在视觉圣经里的 name,一字不差;画面里没有角色写空字符串"
                    },
                    "characters": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "这一镜出镜的角色 id"
                    },
                    "blocking": {
                      "type": "string",
                      "description": "人物站位与走位:谁在哪、朝向哪、从哪走到哪(米为单位的相对位置)"
                    },
                    "shot_size": {
                      "type": "string",
                      "enum": [
                        "extreme wide",
                        "wide",
                        "full",
                        "medium",
                        "medium close-up",
                        "close-up",
                        "extreme close-up"
                      ]
                    },
                    "camera_angle": {
                      "type": "string",
                      "enum": [
                        "eye level",
                        "high angle",
                        "low angle",
                        "overhead",
                        "dutch angle"
                      ]
                    },
                    "lens_mm": {
                      "type": "integer",
                      "minimum": 14,
                      "maximum": 200,
                      "description": "等效全画幅焦段"
                    },
                    "camera_movement": {
                      "type": "string",
                      "enum": [
                        "static",
                        "dolly in",
                        "dolly out",
                        "pan",
                        "tilt",
                        "tracking",
                        "orbit",
                        "crane up",
                        "crane down"
                      ]
                    },
                    "camera_path": {
                      "type": "string",
                      "description": "机位从哪里开始、沿什么路径、到哪里结束,起止构图各是什么"
                    },
                    "subject_action": {
                      "type": "string",
                      "description": "主体在 {{start.shot_seconds}} 秒内可完成的动作节拍"
                    },
                    "lighting": {
                      "type": "string"
                    },
                    "sound_design": {
                      "type": "string",
                      "description": "环境声、拟音、音乐节拍与静默点"
                    },
                    "transition_in": {
                      "type": "string"
                    },
                    "transition_out": {
                      "type": "string"
                    },
                    "continuity_notes": {
                      "type": "string",
                      "description": "人物、服装、空间、光向和运动连续性"
                    },
                    "reference_mode": {
                      "type": "string",
                      "enum": [
                        "keyframes"
                      ],
                      "description": "这一镜用哪条路出片:keyframes = 先按白模机位画首帧(需要时加尾帧)再生成视频,构图最稳;references = 直接把角色三视图、场景设定图和白模运镜视频交给视频模型,适合复杂运镜"
                    },
                    "first_frame_prompt": {
                      "type": "string",
                      "description": "英文,这一镜第一帧画面的完整描述(人物、动作、表情、环境、光线、画风),交给图像模型画首帧"
                    },
                    "generation_prompt": {
                      "type": "string",
                      "description": "英文,交给视频模型:主体动作节拍(须能在 {{start.shot_seconds}} 秒内完成)、表演、环境变化、光影;不要写机位参数(会从白模自动补上),不要要求字幕、UI、Logo 或水印"
                    },
                    "negative_prompt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "shot_number",
                    "start_seconds",
                    "end_seconds",
                    "duration_seconds",
                    "story_beat",
                    "narration",
                    "speaker",
                    "location_id",
                    "location_name",
                    "first_frame_subject",
                    "characters",
                    "blocking",
                    "shot_size",
                    "camera_angle",
                    "lens_mm",
                    "camera_movement",
                    "camera_path",
                    "subject_action",
                    "lighting",
                    "sound_design",
                    "transition_in",
                    "transition_out",
                    "continuity_notes",
                    "reference_mode",
                    "first_frame_prompt",
                    "generation_prompt",
                    "negative_prompt"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "total_duration_seconds",
              "timeline_summary",
              "continuity_bible",
              "shots"
            ],
            "additionalProperties": false
          },
          "json_schema_strict": "true",
          "temperature": 0.65,
          "max_tokens": 64000
        }
      },
      {
        "id": "props",
        "type": "scene_props",
        "name": "可用的 3D 道具",
        "position": {
          "x": 340,
          "y": 940
        },
        "config": {
          "model_ids": ""
        }
      },
      {
        "id": "set_design",
        "type": "llm",
        "name": "设计 3D 白模布景与机位",
        "position": {
          "x": 1400,
          "y": 300
        },
        "config": {
          "profile_id": "",
          "model": "",
          "preset": "precise",
          "system": "你是布景师兼摄影助理。按分镜给每个镜头搭一个 3D 白模布景台，并放好这一镜的相机。\n输出就是 3D 场景的数据格式，会被直接建成场景、渲出参考帧交给图像和视频模型 —— 它决定每一镜的构图。\n\n坐标约定：单位米，Y 朝上，地面 y=0；所有坐标都写**世界坐标**。\n\n**每个地点只搭一份布景,所有在这里拍的镜头共用它。** 按分镜里出现的地点(location)逐个搭:第 k 个地点\n(k 从 0 起)整体放在 x = k*D 附近;**台距 D** 取视觉圣经里最大的那个场景的 width_m 与 depth_m 中较大的那个,\n加 8 米,不足 12 米按 12 米。这个地点里每一个物体、每一台相机的 position / target 都要把 x 加上 k*D。\n只有一个地点时就只有一份布景,放在原点附近。\n\n**每个地点先出一个组。** kind=\"group\",id=\"set-<k>\",name 写这个地点的名字,position 写 [0,0,0],parent_id 写\n空字符串,shot_ids 写空数组;这个地点的 room、陈设、远景体块都把 parent_id 写成 \"set-<k>\"、shot_ids 写空数组\n(空 = 在这里拍的每一镜都看得到)。组在原点,所以**不改变任何坐标** —— 上面那条\"都写世界坐标\"照旧成立。\n\n每个地点的布景:\n- 一个 room(parameters.width/depth/height 取视觉圣经里这个场景的尺寸,position 为 [k*D,0,0],\n  门洞在前后墙正中;没有天花板)。室外场景用一块 plane 当地面、几块 box 当远景体块。\n- 关键陈设用 box / cylinder / table / stairs 概括(桌椅、柜子、门、树……),尺寸按真实比例。**只搭一次**,\n  不要为某一镜再复制一份。\n- **能用真道具就别用方块拼。** 下面那份「可用的 3D 道具」清单里的东西是已经建好的真实模型:\n  kind=\"model\",model_id 写清单里那个 id,name 写道具名,position/rotation 照常摆。清单里给了\n  每件道具实测的长宽高,按它和 figure(人)的比例摆,不要再用 parameters 去\"设定\"它的尺寸\n  (模型自带尺寸,parameters 对它无效)。清单为空就全用基本体。\n\n**每一镜只加两样:这一镜的相机,和这一镜出镜的人偶。** 都挂在这一镜所在地点的组下(parent_id 写 \"set-<k>\"),\nshot_ids 写 [\"shot-<n>\"] —— 只在这一镜出现,别的镜头渲白模时看不到它们:\n- 这一镜出镜的每个角色一个 figure:parameters.height = 角色身高,width 0.4~0.5(肩宽),depth 0.22~0.28;\n  color 用视觉圣经里这个角色的 blockout_color;position 按分镜的站位;rotation[1] 是朝向(度)。\n  id 写成 \"<角色id>-<n>\"(同一个角色每镜一个,站位各不相同)。\n- 物体的 target 写 [0,1,0]、fov 写 45、track 写空数组 —— 只有相机用得上它们;\n  非 model 的物体 model_id 写空字符串。\n\n每镜一台相机：kind=\"camera\",id=\"cam-<n>\";position 是起始机位,target 是起始看向点(一般是主体的胸口\n或眼睛高度 1.3~1.6 米),fov 是竖直视角,由焦段换算:fov = 2*atan(12/焦段毫米)(14mm≈81°,24mm≈53°,\n35mm≈38°,50mm≈27°,85mm≈16°,135mm≈10°)。机位高度按机位角度:平视 1.5~1.7 米,俯拍 2.5~4 米,\n仰拍 0.3~0.8 米。相机必须在房间内、不穿过任何物体,和主体的距离要让景别成立(特写约 0.6~1 米,\n中景 1.5~2.5 米,全景 3~5 米)。\n运镜写在相机的 track 上：static 不写 track;其余至少两档 {time:0,...} 和 {time:{{start.shot_seconds}},...}\n(position/target/fov 三项都写),推 = 沿视线靠近主体,拉 = 远离,摇 = 机位不动只转 target,\n跟 = 机位和 target 一起平移,环绕 = 绕主体转(可加中间一档),升降 = 机位上下移动。\n\nshots:每镜一条 {id:\"shot-<n>\", name:\"镜头 <n>\", duration:{{start.shot_seconds}}, aspect:画幅, easing:\"smooth\",\ncamera_id:\"cam-<n>\", shot_angle:这台相机从主体哪个方向拍}。shot_angle 从 front(正面)、three_quarter(斜侧,\n约 45°)、side(侧面)、back(背面)、high_angle(明显俯拍)、low_angle(明显仰拍)里选;没有主要人物、说不清的写空字符串。\n\n**白模只交代形状、机位和站位,不交代气氛。** 渲出来的那张交给画关键帧的模型照着取景;夜色、色调、天气由画关键帧那一步\n按提示词画。所以:\n- room、地面、陈设、远景体块一律用中性灰,按离相机由近到远分三档:近 \"#c8c8c8\"、中 \"#9a9a9a\"、远 \"#6e6e6e\"\n  —— 夜景、雨天也**不调暗、不上色**;人物照旧用各自的颜色(它们是图例),灯笼、烛火这类本身发光的小件可以留它的颜色;\n- background 写 \"#b8bcc2\",ambient 写 2.5;\n- lighting 只取视觉圣经光线方案里的**方向**:方位角(0=相机默认一侧,90=右侧,180=逆光)和高度角;强度写 3.5、\n  色温 6500、softness 0.5,preset 写 \"custom\"。\n此前跟着视觉圣经把背景、墙面都调成近黑的深蓝灰、灯光按夜色压暗:渲出来几乎一片黑,形状看不出来,画关键帧的模型\n只好照着场景设定图的构图画。\n只输出符合 JSON Schema 的对象。",
          "prompt": "视觉圣经(角色身高与白模颜色、场景尺寸)：\n{{visual_bible.text}}\n\n分镜(每镜的场景、出镜角色、站位、景别、机位角度、焦段、运镜与路径)：\n{{storyboard.text}}\n\n可用的 3D 道具(kind=\"model\" 时 model_id 只能从这里选;尺寸是实测值)：\n{{props.catalog}}\n\n画幅：{{start.aspect_ratio}}。每个地点只搭一份布景，每个镜头放好这一镜的相机和出镜人偶。",
          "response_format": "json_schema",
          "json_schema_name": "blockout_scene",
          "json_schema": {
            "type": "object",
            "properties": {
              "objects": {
                "type": "array",
                "maxItems": 480,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,64}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "group",
                        "room",
                        "box",
                        "cylinder",
                        "sphere",
                        "plane",
                        "stairs",
                        "table",
                        "figure",
                        "model",
                        "camera"
                      ]
                    },
                    "parent_id": {
                      "type": "string"
                    },
                    "position": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      },
                      "minItems": 3,
                      "maxItems": 3
                    },
                    "rotation": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      },
                      "minItems": 3,
                      "maxItems": 3
                    },
                    "model_id": {
                      "type": "string"
                    },
                    "shot_ids": {
                      "type": "array",
                      "maxItems": 32,
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,64}$"
                      }
                    },
                    "entity_id": {
                      "type": "string"
                    },
                    "parameters": {
                      "type": "object",
                      "properties": {
                        "width": {
                          "type": "number",
                          "minimum": 0.01
                        },
                        "height": {
                          "type": "number",
                          "minimum": 0.01
                        },
                        "depth": {
                          "type": "number",
                          "minimum": 0.01
                        },
                        "radius": {
                          "type": "number",
                          "minimum": 0.01
                        },
                        "steps": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 64
                        }
                      },
                      "required": [
                        "width",
                        "height",
                        "depth",
                        "radius",
                        "steps"
                      ],
                      "additionalProperties": false
                    },
                    "color": {
                      "type": "string",
                      "pattern": "^#[0-9a-fA-F]{6}$"
                    },
                    "target": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      },
                      "minItems": 3,
                      "maxItems": 3
                    },
                    "fov": {
                      "type": "number",
                      "minimum": 10,
                      "maximum": 120
                    },
                    "track": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "time": {
                            "type": "number",
                            "minimum": 0
                          },
                          "position": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            },
                            "minItems": 3,
                            "maxItems": 3
                          },
                          "target": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            },
                            "minItems": 3,
                            "maxItems": 3
                          },
                          "fov": {
                            "type": "number",
                            "minimum": 10,
                            "maximum": 120
                          },
                          "rotation": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            },
                            "minItems": 3,
                            "maxItems": 3
                          }
                        },
                        "required": [
                          "time",
                          "position",
                          "target",
                          "fov",
                          "rotation"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "kind",
                    "parent_id",
                    "position",
                    "rotation",
                    "model_id",
                    "shot_ids",
                    "entity_id",
                    "parameters",
                    "color",
                    "target",
                    "fov",
                    "track"
                  ],
                  "additionalProperties": false
                }
              },
              "shots": {
                "type": "array",
                "minItems": 1,
                "maxItems": 32,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "duration": {
                      "type": "number",
                      "minimum": 0.1,
                      "maximum": 120
                    },
                    "aspect": {
                      "type": "string",
                      "enum": [
                        "16:9",
                        "9:16",
                        "1:1"
                      ]
                    },
                    "easing": {
                      "type": "string",
                      "enum": [
                        "smooth",
                        "linear"
                      ]
                    },
                    "camera_id": {
                      "type": "string"
                    },
                    "shot_angle": {
                      "type": "string",
                      "enum": [
                        "front",
                        "three_quarter",
                        "side",
                        "back",
                        "high_angle",
                        "low_angle",
                        ""
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "duration",
                    "aspect",
                    "easing",
                    "camera_id",
                    "shot_angle"
                  ],
                  "additionalProperties": false
                }
              },
              "lighting": {
                "type": "object",
                "properties": {
                  "preset": {
                    "type": "string",
                    "enum": [
                      "custom"
                    ]
                  },
                  "azimuth": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 359
                  },
                  "elevation": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 90
                  },
                  "intensity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 20
                  },
                  "temperature": {
                    "type": "integer",
                    "minimum": 1500,
                    "maximum": 12000
                  },
                  "softness": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  }
                },
                "required": [
                  "preset",
                  "azimuth",
                  "elevation",
                  "intensity",
                  "temperature",
                  "softness"
                ],
                "additionalProperties": false
              },
              "background": {
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              },
              "ambient": {
                "type": "number",
                "minimum": 0,
                "maximum": 10
              }
            },
            "required": [
              "objects",
              "shots",
              "lighting",
              "background",
              "ambient"
            ],
            "additionalProperties": false
          },
          "json_schema_strict": "true",
          "json_match_field": "shots",
          "json_match_items": "{{storyboard.json.shots}}",
          "temperature": 0.2,
          "max_tokens": 64000
        }
      },
      {
        "id": "build_set",
        "type": "scene_create",
        "name": "搭建 3D 白模场景",
        "position": {
          "x": 1720,
          "y": 300
        },
        "config": {
          "name": "{{creative_brief.json.title}} · 白模",
          "layout": ""
        },
        "inputs": [
          "layout"
        ]
      },
      {
        "id": "generate_shots",
        "type": "loop_foreach",
        "name": "逐镜生成画面与口播",
        "position": {
          "x": 2080,
          "y": 460
        },
        "config": {
          "items": "{{storyboard.json.shots}}",
          "inputs": {
            "project_id": "{{video_project.project_id}}",
            "voice_id": "{{start.voice_id}}",
            "scene_id": "{{build_set.scene_id}}",
            "sheets": "{{character_sheets.results}}",
            "locations": "{{location_art.results}}",
            "style": "{{visual_bible.json.style_prompt}}",
            "legend": "{{visual_bible.json.blockout_legend}}",
            "frame_size": "{{frame_plan.value.frame_size}}",
            "video_size": "{{frame_plan.value.video_size}}",
            "aspect_ratio": "{{start.aspect_ratio}}",
            "resolution": "{{start.resolution}}",
            "shot_seconds": "{{start.shot_seconds}}"
          },
          "body": {
            "nodes": [
              {
                "id": "render_blockout",
                "type": "scene_render",
                "name": "渲染本镜白模参考",
                "position": {
                  "x": 80,
                  "y": 140
                },
                "config": {
                  "scene_id": "{{input.scene_id}}",
                  "shot_id": "shot-{{loop.item.shot_number}}",
                  "render": "both",
                  "project_id": "{{input.project_id}}"
                }
              },
              {
                "id": "is_keyframes",
                "type": "condition",
                "name": "这一镜走首尾帧吗",
                "position": {
                  "x": 390,
                  "y": 60
                },
                "config": {
                  "left": "{{loop.item.reference_mode}}",
                  "op": "equals",
                  "right": "keyframes"
                }
              },
              {
                "id": "paint_first_frame",
                "type": "ai_generate",
                "name": "按白模机位画首帧",
                "position": {
                  "x": 700,
                  "y": 60
                },
                "config": {
                  "provider": "",
                  "provider_profile_id": "",
                  "model": "",
                  "kind": "image",
                  "prompt": "{{loop.item.first_frame_prompt}} Reference images, in order: image 1 is always a grey 3D blockout of this exact shot — copy its camera angle, lens and framing; its grey boxes are the real set, never grey shapes. {{blockout_cast.text}} After it come separate single views of the main character — front, side and back of the SAME one person, draw them once — then separate views of the location (a high overview, a reverse eye-level view, close-ups of its walls and floor): copy its architecture, materials, props, lighting and weather, not the framing of any view. Any of them may be missing. Every grey box in image 1 is only a placeholder for real architecture or furniture of this location — never leave a plain wall. Output one single finished picture, never a collage, grid or split screen. Only the characters described above appear; if none are described, the place is empty of people. {{input.style}}",
                  "parameters": {
                    "size": "{{input.frame_size}}"
                  },
                  "frame_aspect": "{{input.aspect_ratio}}",
                  "source_assets": [
                    "{{render_blockout.first_frame_asset_id}}:reference_image",
                    "{{find_subject.asset_ids.0}}:reference_image",
                    "{{find_subject.asset_ids.1}}:reference_image",
                    "{{find_subject.asset_ids.2}}:reference_image",
                    "{{find_location.asset_ids.0}}:reference_image",
                    "{{find_location.asset_ids.1}}:reference_image",
                    "{{find_location.asset_ids.2}}:reference_image",
                    "{{find_location.asset_ids.3}}:reference_image"
                  ],
                  "source_overflow": "keep_first"
                }
              },
              {
                "id": "file_keyframes",
                "type": "asset_update",
                "name": "归档本镜关键帧",
                "position": {
                  "x": 1010,
                  "y": -100
                },
                "config": {
                  "asset_ids": "{{paint_first_frame.asset_id}},{{paint_last_frame.asset_id}}",
                  "name": "镜头 {{loop.item.shot_number}} · 关键帧",
                  "project_id": "{{input.project_id}}"
                }
              },
              {
                "id": "needs_last_frame",
                "type": "condition",
                "name": "这一镜要尾帧吗",
                "position": {
                  "x": 1010,
                  "y": 60
                },
                "config": {
                  "left": "{{loop.item.last_frame_prompt}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "paint_last_frame",
                "type": "ai_generate",
                "name": "按白模机位画尾帧",
                "position": {
                  "x": 1320,
                  "y": 60
                },
                "config": {
                  "provider": "",
                  "provider_profile_id": "",
                  "model": "",
                  "kind": "image",
                  "prompt": "{{loop.item.last_frame_prompt}} This is the last frame of the same shot whose first frame is the reference image right after the blockout — keep characters, wardrobe, lighting and set continuous. Reference images, in order: image 1 is always a grey 3D blockout of this exact shot — copy its camera angle, lens and framing; its grey boxes are the real set, never grey shapes. {{blockout_cast.text}} After it come separate single views of the main character — front, side and back of the SAME one person, draw them once — then separate views of the location (a high overview, a reverse eye-level view, close-ups of its walls and floor): copy its architecture, materials, props, lighting and weather, not the framing of any view. Any of them may be missing. Every grey box in image 1 is only a placeholder for real architecture or furniture of this location — never leave a plain wall. Output one single finished picture, never a collage, grid or split screen. Only the characters described above appear; if none are described, the place is empty of people. {{input.style}}",
                  "parameters": {
                    "size": "{{input.frame_size}}"
                  },
                  "frame_aspect": "{{input.aspect_ratio}}",
                  "source_overflow": "keep_first",
                  "source_assets": [
                    "{{render_blockout.last_frame_asset_id}}:reference_image",
                    "{{paint_first_frame.asset_id}}:reference_image",
                    "{{find_subject.asset_ids.0}}:reference_image",
                    "{{find_subject.asset_ids.1}}:reference_image",
                    "{{find_subject.asset_ids.2}}:reference_image",
                    "{{find_location.asset_ids.0}}:reference_image",
                    "{{find_location.asset_ids.1}}:reference_image",
                    "{{find_location.asset_ids.2}}:reference_image",
                    "{{find_location.asset_ids.3}}:reference_image"
                  ]
                }
              },
              {
                "id": "generate_clip",
                "type": "ai_generate",
                "name": "生成这一镜",
                "position": {
                  "x": 1320,
                  "y": 260
                },
                "config": {
                  "provider": "",
                  "provider_profile_id": "",
                  "model": "",
                  "kind": "video",
                  "prompt": "{{loop.item.generation_prompt}} Camera: {{render_blockout.camera_move}}. Keep every character exactly as in the references. {{dialogue_cue.text}} {{input.style}}",
                  "negative_prompt": "{{loop.item.negative_prompt}}",
                  "parameters": {
                    "duration_seconds": "{{input.shot_seconds}}",
                    "aspect_ratio": "{{input.aspect_ratio}}",
                    "resolution": "{{input.resolution}}"
                  },
                  "frame_aspect": "{{input.aspect_ratio}}",
                  "source_assets": [
                    "{{paint_first_frame.asset_id}}:first_frame",
                    "{{paint_last_frame.asset_id}}:last_frame",
                    "{{input.sheets}}",
                    "{{input.locations}}",
                    "{{render_blockout.first_frame_asset_id}}:reference_image"
                  ],
                  "source_group": "{{loop.item.reference_mode}}"
                }
              },
              {
                "id": "organize_clip",
                "type": "asset_update",
                "name": "归档并命名镜头素材",
                "position": {
                  "x": 1630,
                  "y": 260
                },
                "config": {
                  "asset_ids": "{{generate_clip.asset_id}}{{speak_line.asset_id}}",
                  "name": "镜头 {{loop.item.shot_number}}",
                  "project_id": "{{input.project_id}}"
                }
              },
              {
                "id": "has_subject",
                "type": "condition",
                "name": "首帧里有主角吗",
                "position": {
                  "x": 80,
                  "y": -260
                },
                "config": {
                  "left": "{{loop.item.first_frame_subject}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "blockout_cast",
                "type": "template",
                "name": "白模里的人偶是谁",
                "position": {
                  "x": 390,
                  "y": -340
                },
                "config": {
                  "template": "A coloured humanoid shape in image 1 marks where a character stands ({{input.legend}}) — draw that real person there, never the coloured shape."
                }
              },
              {
                "id": "find_subject",
                "type": "entity_get",
                "name": "在资产库里找首帧主角",
                "position": {
                  "x": 390,
                  "y": -260
                },
                "config": {
                  "kind": "character",
                  "name": "{{loop.item.first_frame_subject}}",
                  "views": "yes",
                  "limit": 3
                }
              },
              {
                "id": "has_location",
                "type": "condition",
                "name": "写了这一镜在哪吗",
                "position": {
                  "x": 80,
                  "y": -420
                },
                "config": {
                  "left": "{{loop.item.location_name}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "find_location",
                "type": "entity_get",
                "name": "在资产库里找这一镜的地点",
                "position": {
                  "x": 390,
                  "y": -420
                },
                "config": {
                  "kind": "location",
                  "name": "{{loop.item.location_name}}",
                  "views": "yes",
                  "limit": 4
                }
              },
              {
                "id": "has_narration",
                "type": "condition",
                "name": "这一镜有人说话吗",
                "position": {
                  "x": 80,
                  "y": 420
                },
                "config": {
                  "left": "{{loop.item.narration}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "has_speaker",
                "type": "condition",
                "name": "是角色在说吗",
                "position": {
                  "x": 390,
                  "y": 420
                },
                "config": {
                  "left": "{{loop.item.speaker}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "find_speaker",
                "type": "entity_get",
                "name": "在资产库里找说话的角色",
                "position": {
                  "x": 700,
                  "y": 420
                },
                "config": {
                  "kind": "character",
                  "name": "{{loop.item.speaker}}",
                  "limit": 1
                }
              },
              {
                "id": "has_voice",
                "type": "condition",
                "name": "选了配音音色吗",
                "position": {
                  "x": 1320,
                  "y": 580
                },
                "config": {
                  "left": "{{input.voice_id}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "narrate",
                "type": "synthesize_speech",
                "name": "用旁白的嗓子念",
                "position": {
                  "x": 1630,
                  "y": 580
                },
                "config": {
                  "text": "{{loop.item.narration}}",
                  "engine": "builtin:clone",
                  "voice": "{{input.voice_id}}"
                }
              },
              {
                "id": "dialogue_cue",
                "type": "template",
                "name": "这一句怎么说",
                "position": {
                  "x": 1010,
                  "y": 420
                },
                "config": {
                  "template": "Spoken dialogue (Mandarin Chinese, generated with the video, in sync with the lips): {{loop.item.speaker}} ({{find_speaker.description}}) says, with the tone and emotion of this moment: 「{{loop.item.narration}}」. Only this one line; no narrator, no other voices."
                }
              },
              {
                "id": "has_character_voice",
                "type": "condition",
                "name": "说话的角色带着嗓子吗",
                "position": {
                  "x": 1010,
                  "y": 260
                },
                "config": {
                  "left": "",
                  "op": "not_empty"
                },
                "inputs": [
                  "left"
                ]
              },
              {
                "id": "voice_sample",
                "type": "synthesize_speech",
                "name": "用这个角色的嗓子念一句参考",
                "position": {
                  "x": 1010,
                  "y": 580
                },
                "config": {
                  "text": "我是{{loop.item.speaker}}。今晚的雨下得很大,铺子里的灯还亮着,我就在这里。",
                  "engine": "",
                  "voice": ""
                },
                "inputs": [
                  "engine",
                  "voice"
                ]
              },
              {
                "id": "speak_line",
                "type": "ai_generate",
                "name": "用角色的嗓子演这一句",
                "position": {
                  "x": 1320,
                  "y": 100
                },
                "config": {
                  "provider": "",
                  "provider_profile_id": "",
                  "model": "",
                  "kind": "video",
                  "prompt": "<Picture 1> is the exact first frame of this shot; keep its composition, characters and set. {{loop.item.generation_prompt}} Camera: {{render_blockout.camera_move}}. Spoken dialogue in Mandarin Chinese, lips in sync: {{loop.item.speaker}} ({{find_speaker.description}}) speaks in exactly the voice of <Audio 1> (same timbre, pitch, age and gender), with the tone and emotion of this moment, and says only: 「{{loop.item.narration}}」. No narrator, no other voices. {{input.style}}",
                  "negative_prompt": "{{loop.item.negative_prompt}}",
                  "frame_aspect": "{{input.aspect_ratio}}",
                  "source_assets": [
                    "{{paint_first_frame.asset_id}}:first_frame",
                    "{{voice_sample.asset_id}}:reference_audio"
                  ]
                }
              }
            ],
            "edges": [
              {
                "id": "shot_blockout_mode",
                "source": "render_blockout",
                "target": "is_keyframes"
              },
              {
                "id": "shot_subject_find",
                "source": "has_subject",
                "target": "find_subject",
                "source_handle": "true"
              },
              {
                "id": "shot_subject_cast",
                "source": "has_subject",
                "target": "blockout_cast",
                "source_handle": "true"
              },
              {
                "id": "shot_location_find",
                "source": "has_location",
                "target": "find_location",
                "source_handle": "true"
              },
              {
                "id": "shot_mode_first",
                "source": "is_keyframes",
                "target": "paint_first_frame",
                "source_handle": "true"
              },
              {
                "id": "shot_first_needs_last",
                "source": "paint_first_frame",
                "target": "needs_last_frame"
              },
              {
                "id": "shot_first_file",
                "source": "paint_first_frame",
                "target": "file_keyframes"
              },
              {
                "id": "shot_needs_last",
                "source": "needs_last_frame",
                "target": "paint_last_frame",
                "source_handle": "true"
              },
              {
                "id": "shot_blockout_generate",
                "source": "render_blockout",
                "target": "has_character_voice"
              },
              {
                "id": "shot_narration_speaker",
                "source": "has_narration",
                "target": "has_speaker",
                "source_handle": "true"
              },
              {
                "id": "shot_speaker_find",
                "source": "has_speaker",
                "target": "find_speaker",
                "source_handle": "true"
              },
              {
                "id": "shot_narrator_speak",
                "source": "has_voice",
                "target": "narrate",
                "source_handle": "true"
              },
              {
                "id": "shot_speaker_cue",
                "source": "find_speaker",
                "target": "dialogue_cue"
              },
              {
                "id": "shot_narrator_voice",
                "source": "has_speaker",
                "target": "has_voice",
                "source_handle": "false"
              },
              {
                "id": "shot_voice_sample",
                "source": "has_character_voice",
                "target": "voice_sample",
                "source_handle": "true"
              },
              {
                "id": "shot_voice_speak",
                "source": "has_character_voice",
                "target": "speak_line",
                "source_handle": "true"
              },
              {
                "id": "shot_unvoiced_generate",
                "source": "has_character_voice",
                "target": "generate_clip",
                "source_handle": "false"
              },
              {
                "id": "d-find_speaker-voice_id-has_character_voice-left",
                "source": "find_speaker",
                "target": "has_character_voice",
                "kind": "data",
                "source_output": "voice_id",
                "target_input": "left"
              },
              {
                "id": "d-find_speaker-voice_engine-voice_sample-engine",
                "source": "find_speaker",
                "target": "voice_sample",
                "kind": "data",
                "source_output": "voice_engine",
                "target_input": "engine"
              },
              {
                "id": "d-find_speaker-voice_id-voice_sample-voice",
                "source": "find_speaker",
                "target": "voice_sample",
                "kind": "data",
                "source_output": "voice_id",
                "target_input": "voice"
              }
            ]
          },
          "output": "",
          "concurrency": 3,
          "max_items": "{{start.max_shots}}"
        }
      },
      {
        "id": "clear_timeline",
        "type": "timeline_clear",
        "name": "清空时间线",
        "position": {
          "x": 2400,
          "y": 660
        },
        "config": {
          "sequence_id": ""
        },
        "inputs": [
          "sequence_id"
        ]
      },
      {
        "id": "assemble_timeline",
        "type": "loop_foreach",
        "name": "按镜头顺序接上时间线",
        "position": {
          "x": 2400,
          "y": 460
        },
        "config": {
          "items": "",
          "inputs": {
            "sequence_id": "{{video_project.sequence_id}}",
            "video_track_id": "{{video_project.video_track_id}}",
            "audio_track_id": "{{video_project.audio_track_id}}",
            "shot_seconds": "{{start.shot_seconds}}"
          },
          "body": {
            "nodes": [
              {
                "id": "append_clip",
                "type": "timeline_append",
                "name": "按镜头顺序接入时间线",
                "position": {
                  "x": 80,
                  "y": 140
                },
                "config": {
                  "sequence_id": "{{input.sequence_id}}",
                  "asset_id": "{{loop.item.generate_clip.asset_id}}{{loop.item.speak_line.asset_id}}",
                  "track_id": "{{input.video_track_id}}",
                  "start": 0,
                  "end": "{{input.shot_seconds}}"
                }
              },
              {
                "id": "has_audio",
                "type": "condition",
                "name": "这一镜合成了口播吗",
                "position": {
                  "x": 390,
                  "y": 140
                },
                "config": {
                  "left": "{{loop.item.narrate.asset_id}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "mute_clip",
                "type": "edit_timeline",
                "name": "有旁白的镜头静音原声",
                "position": {
                  "x": 700,
                  "y": 320
                },
                "config": {
                  "sequence_id": "{{input.sequence_id}}",
                  "operations": "[{\"kind\": \"set_clip_gain\", \"clip_id\": \"{{append_clip.clip_id}}\", \"muted\": true}]"
                }
              },
              {
                "id": "mark_ambience",
                "type": "edit_timeline",
                "name": "把无旁白镜头的原声标成环境声",
                "position": {
                  "x": 700,
                  "y": 500
                },
                "config": {
                  "sequence_id": "{{input.sequence_id}}",
                  "operations": "[{\"kind\": \"set_clip_effects\", \"clip_id\": \"{{append_clip.clip_id}}\", \"effects\": {\"ambience\": true}}]"
                }
              },
              {
                "id": "append_narration",
                "type": "timeline_append",
                "name": "把口播对齐到这一镜",
                "position": {
                  "x": 1010,
                  "y": 140
                },
                "config": {
                  "sequence_id": "{{input.sequence_id}}",
                  "asset_id": "{{loop.item.narrate.asset_id}}",
                  "track_id": "{{input.audio_track_id}}",
                  "at": "",
                  "max_duration": ""
                },
                "inputs": [
                  "at",
                  "max_duration"
                ]
              },
              {
                "id": "caption",
                "type": "template",
                "name": "这一镜的字幕文本",
                "position": {
                  "x": 1320,
                  "y": 140
                },
                "config": {
                  "template": "{{loop.item.loop.item.narration}}"
                }
              },
              {
                "id": "is_spoken",
                "type": "condition",
                "name": "这一镜是角色在说话吗",
                "position": {
                  "x": 700,
                  "y": 680
                },
                "config": {
                  "left": "{{loop.item.loop.item.speaker}}",
                  "op": "not_empty"
                }
              }
            ],
            "edges": [
              {
                "id": "assemble_clip_gate",
                "source": "append_clip",
                "target": "has_audio"
              },
              {
                "id": "assemble_gate_mute",
                "source": "has_audio",
                "target": "mute_clip",
                "source_handle": "true"
              },
              {
                "id": "assemble_mute_narration",
                "source": "mute_clip",
                "target": "append_narration"
              },
              {
                "id": "assemble_gate_spoken",
                "source": "has_audio",
                "target": "is_spoken",
                "source_handle": "false"
              },
              {
                "id": "assemble_silent_ambience",
                "source": "is_spoken",
                "target": "mark_ambience",
                "source_handle": "false"
              },
              {
                "id": "assemble_clip_caption",
                "source": "append_clip",
                "target": "caption"
              },
              {
                "id": "d-append_clip-timeline_start-append_narration-at",
                "source": "append_clip",
                "target": "append_narration",
                "kind": "data",
                "source_output": "timeline_start",
                "target_input": "at"
              },
              {
                "id": "d-append_clip-duration-append_narration-max_duration",
                "source": "append_clip",
                "target": "append_narration",
                "kind": "data",
                "source_output": "duration",
                "target_input": "max_duration"
              }
            ]
          },
          "output": "",
          "concurrency": 1
        },
        "inputs": [
          "items"
        ]
      },
      {
        "id": "narration_subtitles",
        "type": "generate_subtitles",
        "name": "把口播做成字幕",
        "position": {
          "x": 2720,
          "y": 300
        },
        "config": {
          "sequence_id": "",
          "segments": "",
          "start_field": "append_clip.timeline_start",
          "end_field": "append_clip.timeline_end",
          "text_field": "caption.text",
          "break_long_lines": "yes",
          "allow_empty": "yes"
        },
        "inputs": [
          "sequence_id",
          "segments"
        ]
      },
      {
        "id": "export_final",
        "type": "export_sequence",
        "name": "合成并导出最终视频",
        "position": {
          "x": 3040,
          "y": 140
        },
        "config": {
          "sequence_id": ""
        },
        "inputs": [
          "sequence_id"
        ]
      },
      {
        "id": "done_notice",
        "type": "notify",
        "name": "成片完成通知",
        "position": {
          "x": 3360,
          "y": -40
        },
        "config": {
          "title": "视频已生成：{{creative_brief.json.title}}",
          "body": "脚本、角色三视图、3D 白模、各镜视频和最终合成均已完成。最终素材 ID：{{export_final.asset_id}}"
        }
      },
      {
        "id": "output",
        "type": "output",
        "name": "交付完整制作结果",
        "position": {
          "x": 3360,
          "y": 300
        },
        "config": {
          "values": {
            "title": "{{creative_brief.json.title}}",
            "core_thesis": "{{creative_brief.json.core_thesis}}",
            "creative_brief": "{{creative_brief.json}}",
            "narrative_script": "{{narrative_script.json}}",
            "visual_bible": "{{visual_bible.json}}",
            "storyboard": "{{storyboard.json}}",
            "character_sheets": "{{character_sheets.results}}",
            "location_art": "{{location_art.results}}",
            "blockout_scene_id": "{{build_set.scene_id}}",
            "shots": "{{generate_shots.results}}",
            "subtitle_count": "{{narration_subtitles.count}}",
            "project_id": "{{video_project.project_id}}",
            "sequence_id": "{{video_project.sequence_id}}",
            "final_asset_id": "{{export_final.asset_id}}"
          }
        }
      }
    ],
    "edges": [
      {
        "id": "start_brief",
        "source": "start",
        "target": "creative_brief"
      },
      {
        "id": "start_frame_plan",
        "source": "start",
        "target": "frame_plan"
      },
      {
        "id": "brief_narrative",
        "source": "creative_brief",
        "target": "narrative_script"
      },
      {
        "id": "brief_visual",
        "source": "creative_brief",
        "target": "visual_bible"
      },
      {
        "id": "start_library_characters",
        "source": "start",
        "target": "library_characters"
      },
      {
        "id": "start_library_locations",
        "source": "start",
        "target": "library_locations"
      },
      {
        "id": "library_characters_visual",
        "source": "library_characters",
        "target": "visual_bible"
      },
      {
        "id": "library_locations_visual",
        "source": "library_locations",
        "target": "visual_bible"
      },
      {
        "id": "start_props",
        "source": "start",
        "target": "props"
      },
      {
        "id": "props_set",
        "source": "props",
        "target": "set_design"
      },
      {
        "id": "visual_project",
        "source": "visual_bible",
        "target": "video_project"
      },
      {
        "id": "frame_plan_project",
        "source": "frame_plan",
        "target": "video_project"
      },
      {
        "id": "visual_sheets",
        "source": "visual_bible",
        "target": "character_sheets"
      },
      {
        "id": "visual_locations",
        "source": "visual_bible",
        "target": "location_art"
      },
      {
        "id": "project_sheets",
        "source": "video_project",
        "target": "character_sheets"
      },
      {
        "id": "project_locations",
        "source": "video_project",
        "target": "location_art"
      },
      {
        "id": "narrative_storyboard",
        "source": "narrative_script",
        "target": "storyboard"
      },
      {
        "id": "visual_storyboard",
        "source": "visual_bible",
        "target": "storyboard"
      },
      {
        "id": "storyboard_set",
        "source": "storyboard",
        "target": "set_design"
      },
      {
        "id": "set_build",
        "source": "set_design",
        "target": "build_set"
      },
      {
        "id": "build_generate",
        "source": "build_set",
        "target": "generate_shots"
      },
      {
        "id": "sheets_generate",
        "source": "character_sheets",
        "target": "generate_shots"
      },
      {
        "id": "locations_generate",
        "source": "location_art",
        "target": "generate_shots"
      },
      {
        "id": "generate_clear",
        "source": "generate_shots",
        "target": "clear_timeline"
      },
      {
        "id": "clear_assemble",
        "source": "clear_timeline",
        "target": "assemble_timeline"
      },
      {
        "id": "assemble_subtitles",
        "source": "assemble_timeline",
        "target": "narration_subtitles"
      },
      {
        "id": "subtitles_export",
        "source": "narration_subtitles",
        "target": "export_final"
      },
      {
        "id": "export_notice",
        "source": "export_final",
        "target": "done_notice"
      },
      {
        "id": "export_output",
        "source": "export_final",
        "target": "output"
      },
      {
        "id": "d-set_design-json-build_set-layout",
        "source": "set_design",
        "target": "build_set",
        "kind": "data",
        "source_output": "json",
        "target_input": "layout"
      },
      {
        "id": "d-video_project-sequence_id-clear_timeline-sequence_id",
        "source": "video_project",
        "target": "clear_timeline",
        "kind": "data",
        "source_output": "sequence_id",
        "target_input": "sequence_id"
      },
      {
        "id": "d-generate_shots-results-assemble_timeline-items",
        "source": "generate_shots",
        "target": "assemble_timeline",
        "kind": "data",
        "source_output": "results",
        "target_input": "items"
      },
      {
        "id": "d-video_project-sequence_id-narration_subtitles-sequence_id",
        "source": "video_project",
        "target": "narration_subtitles",
        "kind": "data",
        "source_output": "sequence_id",
        "target_input": "sequence_id"
      },
      {
        "id": "d-assemble_timeline-results-narration_subtitles-segments",
        "source": "assemble_timeline",
        "target": "narration_subtitles",
        "kind": "data",
        "source_output": "results",
        "target_input": "segments"
      },
      {
        "id": "d-video_project-sequence_id-export_final-sequence_id",
        "source": "video_project",
        "target": "export_final",
        "kind": "data",
        "source_output": "sequence_id",
        "target_input": "sequence_id"
      }
    ]
  }
}
