{
  "format": "mosael-workflow",
  "version": 1,
  "workflow_revision": 1,
  "name": "Series bible for an episodic show",
  "description": "The first step of an episodic show: give the title, premise and number of episodes, and list your own characters and locations one per line if you want to (name, role, looks, the voice you want) — anything left out is filled in from the premise. It writes the episode outline and the look, draws a turnaround and picks a voice for each character, paints concept art for each location, saves them all to the asset library and saves the bible as a note. Then shoot each episode with \"Topic to finished video\": characters and locations are recognised by name, with the same face and the same voice. Cost: one chat call, plus one turnaround per new character and one concept image per new location (none for those already in the library).",
  "graph_hash": "426aec564115b6ec0125b6170c2d562cdaf714332f5ec07092b3aa0e7c88a2c0",
  "graph": {
    "meta": {
      "template_id": "series_setup",
      "template_version": 2,
      "source": "official"
    },
    "nodes": [
      {
        "id": "start",
        "type": "start",
        "name": "Describe the series",
        "position": {
          "x": 40,
          "y": 300
        },
        "config": {
          "params": {
            "title": "",
            "premise": "",
            "episodes": 10,
            "characters": "",
            "locations": "",
            "style": "Chinese guofeng anime style, 2D cel-shaded illustration with soft ink-wash textures, cinematic lighting, delicate line art.",
            "language": "简体中文"
          },
          "required_params": [
            "title",
            "premise"
          ]
        }
      },
      {
        "id": "library_characters",
        "type": "entity_list",
        "name": "Characters already in the library",
        "position": {
          "x": 340,
          "y": 120
        },
        "config": {
          "kind": "character",
          "limit": 30
        }
      },
      {
        "id": "library_locations",
        "type": "entity_list",
        "name": "Locations already in the library",
        "position": {
          "x": 340,
          "y": 480
        },
        "config": {
          "kind": "location",
          "limit": 30
        }
      },
      {
        "id": "series_bible",
        "type": "llm",
        "name": "Write the series bible and episode outline",
        "position": {
          "x": 660,
          "y": 300
        },
        "config": {
          "profile_id": "",
          "model": "",
          "preset": "creative",
          "system": "你是连续剧的总编剧兼美术总监。按用户给的剧名、梗概和集数，定下整部剧的系列设定。\n\n- **集数照用户填的写**，episodes 恰好那么多集，number 从 1 连续编号；每集有自己的冲突，结尾留钩子，整部剧有完整的弧线。\n- **角色、场景以用户填的为准**：用户列了的，name 一字不差、写了的特征照办，appearance / description 补成英文的画图描述；\n  用户没列或没列全时，按梗概补上故事必需的主要角色(最多 8 个)、常用场景(最多 6 个)。\n- 资产库里已经有的人物、地点会一并给你：故事里的就是其中某一个时，name 一字不差地沿用(它的图直接拿来用，不再重画)，\n  appearance / description 照它的描述写；只是相像的不要硬套。\n- 每个角色挑一把嗓子(voice)，按年龄、性别、性格挑，主要角色尽量不重样；用户写了想要哪把的照办。旁白另挑一把。\n  可选的嗓子：\n- zh-CN-XiaoxiaoNeural:晓晓(女·温暖)\n- zh-CN-XiaoyiNeural:晓伊(女·活泼)\n- zh-CN-YunxiNeural:云希(男·阳光)\n- zh-CN-YunjianNeural:云健(男·解说)\n- zh-CN-YunyangNeural:云扬(男·新闻)\n- zh-CN-YunxiaNeural:云夏(男·少年)\n- zh-CN-liaoning-XiaobeiNeural:晓北(女·东北)\n- zh-CN-shaanxi-XiaoniNeural:晓妮(女·陕西)\n- style_prompt 用户写了画风就照它写成一句英文；没写就按题材定。\n只输出符合 JSON Schema 的对象。",
          "prompt": "剧名：{{start.title}}\n梗概：{{start.premise}}\n集数：{{start.episodes}}\n语言：{{start.language}}\n画风：{{start.style}}\n\n用户定的角色(可能为空)：\n{{start.characters}}\n\n用户定的场景(可能为空)：\n{{start.locations}}\n\n资产库里已有的人物：\n{{library_characters.text}}\n\n资产库里已有的地点：\n{{library_locations.text}}",
          "response_format": "json_schema",
          "json_schema_name": "series_bible",
          "json_schema": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "logline": {
                "type": "string",
                "description": "一句话故事"
              },
              "style_prompt": {
                "type": "string",
                "description": "英文一句话的全剧画风,每一集每张图都带上"
              },
              "narrator_voice": {
                "type": "string",
                "enum": [
                  "zh-CN-XiaoxiaoNeural",
                  "zh-CN-XiaoyiNeural",
                  "zh-CN-YunxiNeural",
                  "zh-CN-YunjianNeural",
                  "zh-CN-YunyangNeural",
                  "zh-CN-YunxiaNeural",
                  "zh-CN-liaoning-XiaobeiNeural",
                  "zh-CN-shaanxi-XiaoniNeural"
                ],
                "description": "旁白的嗓子"
              },
              "episodes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 60,
                "items": {
                  "type": "object",
                  "properties": {
                    "number": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "title": {
                      "type": "string"
                    },
                    "synopsis": {
                      "type": "string",
                      "description": "这一集发生了什么:起因、冲突、结尾的钩子,150 字以内"
                    }
                  },
                  "required": [
                    "number",
                    "title",
                    "synopsis"
                  ],
                  "additionalProperties": false
                }
              },
              "characters": {
                "type": "array",
                "minItems": 1,
                "maxItems": 8,
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "description": "在故事里是谁:年龄、身份、性格"
                    },
                    "appearance": {
                      "type": "string",
                      "description": "英文,交给图像模型画三视图:年龄、脸型发型、服装与配色、体型与身高、标志性道具"
                    },
                    "voice": {
                      "type": "string",
                      "enum": [
                        "zh-CN-XiaoxiaoNeural",
                        "zh-CN-XiaoyiNeural",
                        "zh-CN-YunxiNeural",
                        "zh-CN-YunjianNeural",
                        "zh-CN-YunyangNeural",
                        "zh-CN-YunxiaNeural",
                        "zh-CN-liaoning-XiaobeiNeural",
                        "zh-CN-shaanxi-XiaoniNeural"
                      ],
                      "description": "这个角色的嗓子"
                    }
                  },
                  "required": [
                    "name",
                    "role",
                    "appearance",
                    "voice"
                  ],
                  "additionalProperties": false
                }
              },
              "locations": {
                "type": "array",
                "minItems": 1,
                "maxItems": 6,
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string",
                      "description": "英文,交给图像模型画设定图:空间、时代、材质、关键陈设、光源、大致尺寸"
                    }
                  },
                  "required": [
                    "name",
                    "description"
                  ],
                  "additionalProperties": false
                }
              },
              "bible_markdown": {
                "type": "string",
                "description": "给人读的系列设定文档(Markdown):一句话故事、画风、角色表(名字/身份/嗓子)、场景表、分集大纲"
              }
            },
            "required": [
              "title",
              "logline",
              "style_prompt",
              "narrator_voice",
              "episodes",
              "characters",
              "locations",
              "bible_markdown"
            ],
            "additionalProperties": false
          },
          "json_schema_strict": "true",
          "temperature": 0.8,
          "max_tokens": 16000
        }
      },
      {
        "id": "character_assets",
        "type": "loop_foreach",
        "name": "Every character: draw a turnaround if new, save it with its voice",
        "position": {
          "x": 980,
          "y": 160
        },
        "config": {
          "items": "{{series_bible.json.characters}}",
          "inputs": {
            "style": "{{series_bible.json.style_prompt}}",
            "title": "{{series_bible.json.title}}"
          },
          "body": {
            "nodes": [
              {
                "id": "find",
                "type": "entity_get",
                "name": "Look it up in the asset library",
                "position": {
                  "x": 80,
                  "y": 140
                },
                "config": {
                  "kind": "character",
                  "name": "{{loop.item.name}}",
                  "limit": 1
                }
              },
              {
                "id": "has_art",
                "type": "condition",
                "name": "Does the library have its images?",
                "position": {
                  "x": 380,
                  "y": 140
                },
                "config": {
                  "left": "{{find.asset_ids.0}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "sheet",
                "type": "ai_generate",
                "name": "Draw this character's turnaround",
                "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": "Save as a character asset with its voice",
                "config": {
                  "kind": "character",
                  "name": "{{loop.item.name}}",
                  "prompt": "{{loop.item.appearance}}",
                  "description": "{{loop.item.role}}",
                  "asset_ids": "",
                  "role": "turnaround",
                  "engine": "builtin:edge",
                  "voice": "{{loop.item.voice}}",
                  "tags": "{{input.title}}"
                },
                "position": {
                  "x": 980,
                  "y": 140
                },
                "inputs": [
                  "asset_ids"
                ]
              }
            ],
            "edges": [
              {
                "id": "find_check",
                "source": "find",
                "target": "has_art"
              },
              {
                "id": "missing_draw",
                "source": "has_art",
                "target": "sheet",
                "source_handle": "false"
              },
              {
                "id": "find_save",
                "source": "find",
                "target": "save"
              },
              {
                "id": "d-sheet-asset_id-save-asset_ids",
                "source": "sheet",
                "target": "save",
                "kind": "data",
                "source_output": "asset_id",
                "target_input": "asset_ids"
              }
            ]
          },
          "output": "{{save.entity_id}}",
          "concurrency": 2
        }
      },
      {
        "id": "location_assets",
        "type": "loop_foreach",
        "name": "Every location: paint concept art if new, save it",
        "position": {
          "x": 980,
          "y": 440
        },
        "config": {
          "items": "{{series_bible.json.locations}}",
          "inputs": {
            "style": "{{series_bible.json.style_prompt}}",
            "title": "{{series_bible.json.title}}"
          },
          "body": {
            "nodes": [
              {
                "id": "find",
                "type": "entity_get",
                "name": "Look it up in the asset library",
                "position": {
                  "x": 80,
                  "y": 140
                },
                "config": {
                  "kind": "location",
                  "name": "{{loop.item.name}}",
                  "limit": 1,
                  "role": "design_sheet"
                }
              },
              {
                "id": "has_art",
                "type": "condition",
                "name": "Does the library have its images?",
                "position": {
                  "x": 380,
                  "y": 140
                },
                "config": {
                  "left": "{{find.asset_ids.0}}",
                  "op": "not_empty"
                }
              },
              {
                "id": "art",
                "type": "ai_generate",
                "name": "Paint this location's design sheet",
                "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": "Save as a location asset",
                "config": {
                  "kind": "location",
                  "name": "{{loop.item.name}}",
                  "prompt": "{{loop.item.description}}",
                  "asset_ids": "",
                  "role": "design_sheet",
                  "tags": "{{input.title}}"
                },
                "position": {
                  "x": 980,
                  "y": 140
                },
                "inputs": [
                  "asset_ids"
                ]
              }
            ],
            "edges": [
              {
                "id": "find_check",
                "source": "find",
                "target": "has_art"
              },
              {
                "id": "missing_draw",
                "source": "has_art",
                "target": "art",
                "source_handle": "false"
              },
              {
                "id": "find_save",
                "source": "find",
                "target": "save"
              },
              {
                "id": "d-art-asset_id-save-asset_ids",
                "source": "art",
                "target": "save",
                "kind": "data",
                "source_output": "asset_id",
                "target_input": "asset_ids"
              }
            ]
          },
          "output": "{{save.entity_id}}",
          "concurrency": 2
        }
      },
      {
        "id": "bible_note",
        "type": "note_create",
        "name": "Save the series bible as a note",
        "position": {
          "x": 980,
          "y": 680
        },
        "config": {
          "title": "{{series_bible.json.title}} · 系列设定",
          "markdown": "{{series_bible.json.bible_markdown}}",
          "tags": "{{series_bible.json.title}}"
        }
      },
      {
        "id": "output",
        "type": "output",
        "name": "Hand over the series bible",
        "position": {
          "x": 1300,
          "y": 300
        },
        "config": {
          "values": {
            "title": "{{series_bible.json.title}}",
            "style_prompt": "{{series_bible.json.style_prompt}}",
            "narrator_voice": "{{series_bible.json.narrator_voice}}",
            "episodes": "{{series_bible.json.episodes}}",
            "characters": "{{character_assets.results}}",
            "locations": "{{location_assets.results}}",
            "note_id": "{{bible_note.note_id}}"
          }
        }
      }
    ],
    "edges": [
      {
        "id": "start_library_characters",
        "source": "start",
        "target": "library_characters"
      },
      {
        "id": "start_library_locations",
        "source": "start",
        "target": "library_locations"
      },
      {
        "id": "start_bible",
        "source": "start",
        "target": "series_bible"
      },
      {
        "id": "library_characters_bible",
        "source": "library_characters",
        "target": "series_bible"
      },
      {
        "id": "library_locations_bible",
        "source": "library_locations",
        "target": "series_bible"
      },
      {
        "id": "bible_characters",
        "source": "series_bible",
        "target": "character_assets"
      },
      {
        "id": "bible_locations",
        "source": "series_bible",
        "target": "location_assets"
      },
      {
        "id": "bible_to_note",
        "source": "series_bible",
        "target": "bible_note"
      },
      {
        "id": "characters_output",
        "source": "character_assets",
        "target": "output"
      },
      {
        "id": "locations_output",
        "source": "location_assets",
        "target": "output"
      },
      {
        "id": "note_output",
        "source": "bible_note",
        "target": "output"
      }
    ]
  }
}
