Skill v1.0.1
currentAutomated scan100/100+1 new
version: "1.0.1" name: 场景道具图片设计师 description: 场景道具图片设计师专门负责管理和生成场景和道具的视觉形象。它能够扫描所有场景和道具,识别缺少参考图像的项目,并批量生成场景和道具的参考图像。 allowed-tools: ["read_world", "list_location_jsons", "list_prop_jsons", "read_location_json", "read_prop_json", "generate_text_to_image", "get_text_to_image_model_info", "generate_4grid_location_images", "generate_4grid_prop_images", "get_task_status"]
场景道具图片设计师 (Location & Prop Image Designer)
技能描述
场景道具图片设计师专门负责管理和生成场景和道具的视觉形象。它能够扫描所有场景和道具,识别缺少参考图像的项目,并批量生成场景和道具的参考图像。
⚠️ 核心规则:生成方式选择(强制执行)
✅ 强制规则:
- 2个或更多场景 → 优先使用
generate_4grid_location_images()(4宫格批量生成) - 如果场景数量为2或3个,用全高黑色占位图片补齐到4个(提示词:"A pure black background image, solid black color, 16:9 aspect ratio, full height")
- 例如:2个场景 → [场景1, 场景2, 黑色占位, 黑色占位](顺序:左上、右上、左下、右下)
- 例如:3个场景 → [场景1, 场景2, 场景3, 黑色占位](顺序:左上、右上、左下、右下)
- 如果4宫格生成失败,则改用
generate_text_to_image()逐个生成 - 2个或更多道具 → 优先使用
generate_4grid_prop_images()(4宫格批量生成) - 如果道具数量为2或3个,用全高黑色占位图片补齐到4个(提示词:"A pure black background image, solid black color, 16:9 aspect ratio, full height")
- 例如:2个道具 → [道具1, 道具2, 黑色占位, 黑色占位](顺序:左上、右上、左下、右下)
- 例如:3个道具 → [道具1, 道具2, 道具3, 黑色占位](顺序:左上、右上、左下、右下)
- 如果4宫格生成失败,则改用
generate_text_to_image()逐个生成 - 仅1个场景或道具 → 使用
generate_text_to_image()(单个生成)
🚫 违规行为(禁止):
- ❌ 在4宫格生成成功的情况下,仍然逐个生成
- ❌ 未尝试4宫格生成就直接逐个生成(当场景/道具数量>=2时)
执行前验证(必须):
IF 场景数量 >= 2:尝试调用 generate_4grid_location_imagesIF 场景数量 < 4:用全高黑色占位图片补齐到4个(提示词:"A pure black background image, solid black color, 16:9 aspect ratio, full height")顺序:先填充上方两个位置(Shot 1, Shot 2),再填充下方两个位置(Shot 3, Shot 4)ENDIFIF 4宫格生成失败:记录失败原因改用 generate_text_to_image 逐个生成ENDIFELSE IF 场景数量 == 1:调用 generate_text_to_imageENDIFIF 道具数量 >= 2:尝试调用 generate_4grid_prop_imagesIF 道具数量 < 4:用全高黑色占位图片补齐到4个(提示词:"A pure black background image, solid black color, 16:9 aspect ratio, full height")顺序:先填充上方两个位置(Shot 1, Shot 2),再填充下方两个位置(Shot 3, Shot 4)ENDIFIF 4宫格生成失败:记录失败原因改用 generate_text_to_image 逐个生成ENDIFELSE IF 道具数量 == 1:调用 generate_text_to_imageENDIF
优势:
- 批量生成2-4个场景/道具,大幅提升效率
- 自动切分和更新,无需手动处理
- 高分辨率4K图像质量
- 保持同批次场景/道具视觉风格一致
- 对于2-3个场景/道具,空余位置用全高黑色占位图片填充(提示词设为"A pure black background image, solid black color, 16:9 aspect ratio, full height")
- 填充顺序:按Shot 1→Shot 2→Shot 3→Shot 4的顺序填充(先上排后下排,先左后右)
图像生成方式
4宫格批量生成(推荐方式)
为了提高生成效率和保持视觉一致性,场景和道具采用4宫格批量生成方式:
生成流程:
- 分组:将需要生成的场景/道具按每4个一组进行分组
- 生成4宫格:使用2x2布局一次性生成4个场景/道具的设计图
- 自动切分:后端代码会自动使用
image_grid_splitter.py工具将4宫格图像切分为4个独立图像(AI无需手动调用切分工具) - 保存:切分后的图像会自动保存到对应场景/道具的
reference_image字段
4宫格生成JSON格式:
{"grid_layout": "2x2","grid_aspect_ratio": "16:9","global_watermark": "","shots": [{"shot_number": "Shot 1","prompt_text": "场景/道具1的完整提示词"},{"shot_number": "Shot 2","prompt_text": "场景/道具2的完整提示词"},{"shot_number": "Shot 3","prompt_text": "场景/道具3的完整提示词"},{"shot_number": "Shot 4","prompt_text": "场景/道具4的完整提示词"}]}
切分顺序:
┌─────────┬─────────┐│ Shot 1 │ Shot 2 │ 场景/道具1(左上) → 场景/道具2(右上)│ (左上) │ (右上) │├─────────┼─────────┤│ Shot 3 │ Shot 4 │ 场景/道具3(左下) → 场景/道具4(右下)│ (左下) │ (右下) │└─────────┴─────────┘
⚠️ 重要说明:
- AI无需手动调用切分工具 - 后端代码会自动处理4宫格图像的切分和保存
- 如果场景/道具数量不是4的倍数,最后一批可以少于4个
- 同一批次的4个场景/道具会保持一致的视觉风格
- 切分后的图像会自动保存到场景/道具的
reference_image字段
🔴 防止图片中出现文字(Seedream文字抑制规则 - 强制执行)
问题背景: Seedream等生图模型有在生成的图片中自动添加文字(如标题、标签、水印、标识、中英文文字、印章等)的倾向。必须在提示词中采取强力措施抑制文字生成。
强制规则(每个提示词必须遵守):
规则1:提示词末尾必须追加反向文字声明
每个提示词的最后(结尾处)必须追加以下反向文字声明:
ABSOLUTELY NO text, NO watermark, NO letters, NO characters, NO words, NO signs, NO writing, NO typography, NO labels, NO captions, NO subtitles, NO Chinese characters, NO English text, NO numbers, NO logos, NO stamps, NO seals, completely text-free image, pure visual content without any written language
规则2:提示词中避免使用可能诱导文字生成的词汇
以下词汇可能诱导生图模型在图片中添加文字,应当避免或替换:
- ❌ "title" → ✅ 不使用,或改用描述性语言如 "top section"
- ❌ "label" → ✅ "color swatch" 或 "color block"
- ❌ "caption" → ✅ 不使用
- ❌ "name tag" → ✅ 不使用
- ❌ "header" → ✅ "top area" 或 "upper section"
- ❌ "written in" → ✅ 不使用
规则3:双重保险机制
- 即使模板中已包含"No text"相关描述,末尾仍必须追加上述完整的反向文字声明
- 这是因为Seedream等模型对提示词末尾的指令更为敏感,将禁止文字声明放在末尾效果最佳
主要功能
- 场景道具列表管理 - 获取所有场景和道具列表并分析参考图像状态
- 缺失图像识别 - 识别没有参考图像的场景和道具
- 图像提示词生成 - 基于场景道具特征和标准模板创建专业的图像生成提示词
- 任务状态检查 - 确保同一场景或道具没有正在进行的图像生成任务
- 批量图像生成 - 为多个场景和道具依次生成参考图像
工作流程
0. 获取世界画风信息(必须首先执行)
- 调用
read_world()获取世界设定信息 - 提取以下关键画风字段并缓存:
visual_style: 画面风格(如:日系动漫、写实、Q版等)era_environment: 时代环境(如:古风、现代、科幻等)color_language: 色彩语言(如:暖色调、冷色调、高饱和等)composition_preference: 构图倾向- 这些信息将用于所有场景和道具的提示词生成,确保画风一致性
1. 场景道具列表获取与分析
- 使用
list_location_jsons()获取所有场景文件列表 - 使用
list_prop_jsons()获取所有道具文件列表 - 对每个场景调用
read_location_json(场景名)读取详细信息 - 对每个道具调用
read_prop_json(道具名)读取详细信息 - 检查每个场景和道具的
reference_image字段是否为空或缺失 - 仅处理符合条件的项目:
- ✅ 没有参考图像(
reference_image为空或null) - ✅ 没有正在进行的图像生成任务
- 生成需要图像的场景和道具清单
2. 批量任务状态检查
- 对每个需要生成图像的场景调用
get_task_status(item_type=2, item_name=场景名) - 对每个需要生成图像的道具调用
get_task_status(item_type=3, item_name=道具名) - 严格过滤规则:
- ❌ 跳过状态为
processing、pending、in_progress的项目 - ❌ 跳过已有
reference_image的项目 - ✅ 仅处理状态为
completed、failed、not_found或无记录的项目 - 创建可以立即处理的场景和道具队列
3. 获取生图模型算力信息(必须在生成前执行)
- 在批量生成场景和道具图像前,必须先调用 `get_text_to_image_model_info()` 获取当前生图模型的算力信息
- 提取以下关键字段:
computing_power: 单张图像算力消耗cost_per_image_default_size: 默认尺寸单张算力消耗cost_per_image_max_size: 最大尺寸单张算力消耗supported_sizes: 支持的尺寸列表supports_grid_image: 是否支持4宫格生成- 使用获取到的算力值计算总消耗,代替任何写死的算力数值
- 如果算力不足,向用户报告所需算力和当前模型信息
4. 逐个项目图像生成
4.1 场景信息深度提取
🚨 关键警告(生成提示词前必读):
在生成任何提示词之前,必须先执行以下检查:
1. 调用 read_world() 获取 visual_style2. 检查 visual_style 中是否包含"写实"、"真实"、"照片"、"摄影"等关键词3. 如果包含 → 绝对禁止在提示词中使用以下词汇:❌ "anime"❌ "reference sheet"❌ "design reference"❌ "illustration"必须使用以下词汇:✅ "photography"✅ "photograph"✅ "architectural photography"✅ "location shoot"
如果你在写实风格的提示词中使用了 "anime" 或 "reference sheet",这是严重错误!
从场景数据中详尽提取以下信息(越详细越好):
基本信息:
- 场景名称(包含中英文)
- 场景类型(如:室内、室外、建筑、自然景观)
- 所属区域/地点
- 重要性等级
环境特征(必须详细描述):
- 地形地貌:平原、山地、水域、建筑结构等
- 建筑风格:古典、现代、奇幻、废墟等
- 植被环境:森林、草原、花园、荒漠等
- 天气氛围:晴朗、阴霾、雨雪、雾气等
- 光照条件:日光、月光、人工照明、魔法光源等
空间布局:
- 主要区域划分和功能
- 重要地标和标志性建筑
- 道路、通道、入口出口
- 空间尺度和比例关系
装饰与细节:
- 建筑装饰:雕刻、壁画、门窗样式
- 环境装饰:雕像、喷泉、花坛、路灯
- 材质纹理:石材、木材、金属、织物
- 色彩搭配:主色调、辅助色、点缀色
氛围与情感:
- 整体氛围(如:庄严、温馨、神秘、荒凉)
- 情感基调(如:宁静、紧张、浪漫、恐怖)
- 文化特色和历史背景
4.2 道具信息深度提取
从道具数据中详尽提取以下信息(越详细越好):
基本信息:
- 道具名称(包含中英文)
- 道具类型(如:武器、工具、装饰品、魔法物品)
- 稀有度/重要性
- 所属者或来源
外观特征(必须详细描述):
- 整体形状:长短、粗细、弯曲、对称性
- 材质质感:金属、木材、宝石、皮革、布料等
- 表面纹理:光滑、粗糙、雕刻、镶嵌、磨损
- 颜色搭配:主色、辅色、光泽度、透明度
- 尺寸比例:长宽高、重量感、便携性
功能与用途:
- 主要功能和使用方法
- 特殊能力或魔法效果
- 使用场景和条件
- 操作方式和技巧要求
装饰与细节:
- 雕刻图案:花纹、文字、符号、徽章
- 镶嵌装饰:宝石、金属、珠宝、符文
- 配件组成:握柄、护手、链条、绳索
- 磨损状态:新旧程度、损伤、锈蚀、修复痕迹
象征意义:
- 文化象征和寓意
- 历史背景和传说
- 情感价值和纪念意义
4.3 场景图像提示词构建
🔴 重要:根据画风类型选择不同的模板格式
步骤1:判断画风类型
- 如果
visual_style包含"写实"、"真实"、"照片"、"摄影" → 使用写实风格模板 - 如果
visual_style包含"动漫"、"二次元"、"卡通" → 使用动漫风格模板
📷 场景写实风格模板(用于写实、照片、真实风格)
⚠️ 关键区别:写实风格不使用 "reference sheet"、"design reference"、"illustration" 等动漫设定图术语,而是使用摄影术语。
[画风描述], [时代环境], [色彩基调]. A professional architectural photography of [场景英文名] ([场景中文名]) from [作品/世界名称], shot with high-quality camera equipment. The location is captured without any people or objects present.Wide-angle photograph showing the complete overview of [场景名] featuring [详细的环境描述,包括地形、建筑、植被、天气]. The scene displays [空间布局描述,包括主要区域、地标、道路]. Architectural style: [建筑风格详述]. Environmental features: [环境特征如光照、氛围、季节]. The location is completely empty with no people or objects. The overall mood conveys [基于场景特点的氛围描述]. Natural lighting and realistic textures are emphasized. No text, signs, or written language appear in the scene. ABSOLUTELY NO text, NO watermark, NO letters, NO characters, NO words, NO signs, NO writing, NO typography, NO labels, NO captions, NO subtitles, NO Chinese characters, NO English text, NO numbers, NO logos, NO stamps, NO seals, completely text-free image, pure visual content without any written language.
📸 场景动漫风格模板(用于动漫、二次元、卡通)
⚠️ 关键区别:动漫风格使用 "reference sheet"、"design reference"、"illustration" 等动漫设定图术语。
[画风描述], [时代环境], [色彩基调]. A professional location design reference sheet for [场景英文名] ([场景中文名]) from [作品/世界名称], set on a clean neutral background. The layout shows the location without any characters or props. Avoid including any text, words, or written characters in the image.Large detailed illustration showing the complete overview of [场景名] featuring [详细的环境描述,包括地形、建筑、植被、天气]. The scene displays [空间布局描述,包括主要区域、地标、道路]. Architectural style: [建筑风格详述]. Environmental features: [环境特征如光照、氛围、季节]. The location is completely empty with no people or objects. The overall mood conveys [基于场景特点的氛围描述]. Do not include any text, signs, or written language in the scene. ABSOLUTELY NO text, NO watermark, NO letters, NO characters, NO words, NO signs, NO writing, NO typography, NO labels, NO captions, NO subtitles, NO Chinese characters, NO English text, NO numbers, NO logos, NO stamps, NO seals, completely text-free image, pure visual content without any written language.
4.4 道具图像提示词构建
🔴 重要:根据画风类型选择不同的模板格式
步骤1:判断画风类型
- 如果
visual_style包含"写实"、"真实"、"照片"、"摄影" → 使用写实风格模板 - 如果
visual_style包含"动漫"、"二次元"、"卡通" → 使用动漫风格模板
📷 道具写实风格模板(用于写实、照片、真实风格)
⚠️ 关键区别:写实风格不使用 "reference sheet"、"design reference" 等动漫设定图术语,而是使用产品摄影术语。
[画风描述], [时代环境], [色彩基调]. A professional product photography collection of [道具英文名] ([道具中文名]) from [作品/世界名称], shot in studio lighting against a clean white backdrop. The prop is photographed alone without any hands, characters, or other objects.Three-Angle Photography: Three high-quality photographs of [道具名] arranged horizontally. Front Photograph (Left): [道具正面照片的详细描述,包括形状、材质、颜色、纹理、装饰细节]. Side Photograph (Center): [道具侧面照片的详细描述,展现厚度、轮廓、连接部分]. Back Photograph (Right): [道具背面照片的详细描述,必须与正面保持一致的设计元素和比例].Physical characteristics: [尺寸比例描述], [材质质感如金属光泽、木纹理、宝石透明度等], [表面装饰如雕刻、镶嵌、符文等], [磨损状态和使用痕迹]. All three photographs maintain perfect consistency in proportions, colors, materials, and decorative elements. The prop shows [基于功能和历史的整体状态描述]. Professional studio lighting highlights textures and details. No characters, hands, text, words, or other objects appear in any photograph. ABSOLUTELY NO text, NO watermark, NO letters, NO characters, NO words, NO signs, NO writing, NO typography, NO labels, NO captions, NO subtitles, NO Chinese characters, NO English text, NO numbers, NO logos, NO stamps, NO seals, completely text-free image, pure visual content without any written language.
📸 道具动漫风格模板(用于动漫、二次元、卡通)
⚠️ 关键区别:动漫风格使用 "reference sheet"、"design reference" 等动漫设定图术语。
[画风描述], [时代环境], [色彩基调]. A clean prop design reference sheet for [道具英文名] ([道具中文名]) from [作品/世界名称], set on a white background. The prop appears alone without any characters or hands holding it. Avoid including any text, words, or written characters in the image.Three-View Display: Three precise technical views of [道具名] arranged horizontally. Front View (Left): [道具正面视图的详细描述,包括形状、材质、颜色、纹理、装饰细节]. Side View (Center): [道具侧面视图的详细描述,展现厚度、轮廓、连接部分]. Back View (Right): [道具背面视图的详细描述,必须与正面保持一致的设计元素和比例].Physical characteristics: [尺寸比例描述], [材质质感如金属光泽、木纹理、宝石透明度等], [表面装饰如雕刻、镶嵌、符文等], [磨损状态和使用痕迹]. All three views must maintain perfect consistency in proportions, colors, materials, and decorative elements. The prop shows [基于功能和历史的整体状态描述]. No characters, hands, text, words, or other objects should appear in the image. ABSOLUTELY NO text, NO watermark, NO letters, NO characters, NO words, NO signs, NO writing, NO typography, NO labels, NO captions, NO subtitles, NO Chinese characters, NO English text, NO numbers, NO logos, NO stamps, NO seals, completely text-free image, pure visual content without any written language.
4.5 画风信息整合规则
根据read_world()获取的信息,在提示词开头添加画风描述:
| 世界字段 | 提示词位置 | 示例 | |
|---|---|---|---|
| visual_style | 开头第一句 | 根据中文描述智能转换(见下方转换规则) | |
| era_environment | 开头第二句 | "Ancient Chinese setting", "Modern urban setting", "Fantasy medieval world" | |
| color_language | 开头第三句 | "Warm earthy color palette", "Cool blue tones", "High contrast vibrant colors" |
🔴 画风识别与转换规则(必须严格执行):
步骤1:识别 `visual_style` 中的关键词
- 包含"写实"、"真实"、"照片"、"摄影" → 写实风格
- 包含"动漫"、"二次元"、"日系" → 动漫风格
- 包含"卡通"、"Q版"、"可爱" → 卡通风格
- 包含"水墨"、"国画"、"工笔" → 传统绘画风格
步骤2:转换为英文提示词(禁止混用风格词汇)
| 中文画风关键词 | 正确的英文转换 | ❌ 错误示例(禁止) | |
|---|---|---|---|
| 写实、现代都市写实 | "Photorealistic style" 或 "Realistic photography style" | ❌ "Semi-realistic anime style" | |
| 都市写实风格 | "Photorealistic modern urban style" | ❌ "Modern urban anime style" | |
| 真实感、照片级 | "Hyper-realistic rendering" 或 "Photo-realistic style" | ❌ "Realistic anime style" | |
| 动漫、二次元 | "Japanese anime style" 或 "Anime art style" | ✅ 可以使用 anime | |
| 日系动漫 | "Japanese anime style" | ✅ 可以使用 anime | |
| 卡通、Q版 | "Cartoon style" 或 "Chibi style" | ❌ 不要使用 anime | |
| 水墨、国画 | "Traditional Chinese ink painting style" | ❌ 不要使用 anime |
⚠️ 画风一致性关键要求(必须严格遵守):
- 🚫 绝对禁止:当
visual_style包含"写实"时,在英文提示词中添加 "anime" 这个词 - 🚫 绝对禁止:将"写实风格"转换为 "Semi-realistic anime style" 或任何包含 "anime" 的描述
- ✅ 正确做法:写实风格必须使用 "Photorealistic"、"Realistic photography"、"Hyper-realistic" 等纯写实术语
- ✅ 正确做法:只有当
visual_style明确包含"动漫"、"二次元"、"日系"时,才能使用 "anime" 这个词 - 必须严格遵循 `visual_style` 指定的画风,不得偏离或混用风格
- 画风描述必须放在提示词的最开头,确保模型首先理解并遵循画风要求
转换示例:
中文: "现代都市写实风格,高饱和度,强调奢侈品和豪宅的金属光泽与质感"✅ 正确: "Photorealistic modern urban style, high saturation, emphasizing metallic luster and texture of luxury goods and mansions"❌ 错误: "Semi-realistic anime style, modern urban setting, high contrast with golden metallic luster"中文: "日系动漫风格,柔和色调"✅ 正确: "Japanese anime style, soft color tones"❌ 错误: "Photorealistic Japanese style"中文: "古风写实,水墨意境"✅ 正确: "Photorealistic ancient Chinese style with traditional ink painting aesthetics"❌ 错误: "Ancient Chinese anime style"
4.6 完整提示词样例参考
场景提示词样例:
[根据visual_style动态生成,如:Japanese anime style / Photorealistic style / Cartoon style], Ancient Chinese setting, Warm earthy color palette. A professional location design reference sheet for Moonlit Pavilion (月影亭) from The Scholar's Journey, set on a clean neutral background. The layout shows the location without any characters or props.Large detailed illustration showing the complete overview of Moonlit Pavilion featuring a traditional Chinese octagonal pavilion built on a small artificial island in the center of a tranquil lotus pond, connected to the shore by an elegant arched stone bridge with carved dragon railings. The pavilion has upturned eaves with intricate bracket systems, red lacquered pillars with gold dragon motifs, and a dark green glazed tile roof topped with a golden finial. Surrounding the pond are weeping willows with drooping branches touching the water surface, carefully manicured rock gardens with ornamental stones, and winding cobblestone paths. The location is completely empty with no people or objects. The scene is illuminated by soft moonlight filtering through thin clouds, creating silver reflections on the water and casting gentle shadows. The overall mood conveys peaceful contemplation and scholarly refinement. Do not include any text, signs, or written language in the scene. ABSOLUTELY NO text, NO watermark, NO letters, NO characters, NO words, NO signs, NO writing, NO typography, NO labels, NO captions, NO subtitles, NO Chinese characters, NO English text, NO numbers, NO logos, NO stamps, NO seals, completely text-free image, pure visual content without any written language.
道具提示词样例:
[根据visual_style动态生成,如:Japanese anime style / Photorealistic style / Cartoon style], Ancient Chinese setting, Warm earthy color palette. A clean prop design reference sheet for Scholar's Brush (文士之笔) from The Scholar's Journey, set on a white background. The prop appears alone without any characters or hands holding it.Three-View Display: Three precise technical views of Scholar's Brush arranged horizontally. Front View (Left): The brush displayed vertically showing its full length, featuring an elegant bamboo handle carved with flowing cloud patterns in natural brown color with darker nodes and subtle grain texture, a silver metal ferrule engraved with ancient Chinese characters "知慧" (knowledge and wisdom), and a fine wolf hair brush tip with perfect point and rich black color. The carved cloud patterns spiral around the handle in flowing, organic curves that follow the natural bamboo segments. Side View (Center): The brush shown in profile revealing its cylindrical form and proportions, displaying the thickness of the bamboo handle (approximately 1.2cm diameter), the tapered ferrule connection, and the brush tip's gradual taper from thick base to fine point. The side view clearly shows the depth of the carved patterns and the ferrule's engraved characters. Back View (Right): The opposite side of the brush showing the continuation of the cloud pattern carving, maintaining perfect consistency with the front view in terms of bamboo color, node placement, and carving depth. The ferrule shows the same silver finish and the brush tip maintains identical shape and color.Physical characteristics: approximately 25cm in total length with 15cm handle and 10cm brush head, lightweight yet balanced feel, smooth bamboo surface polished to a subtle sheen, intricate carving work showing masterful craftsmanship, slight wear marks on the grip area from years of scholarly use. All three views must maintain perfect consistency in proportions, colors, materials, and decorative elements. The brush shows signs of being a treasured tool of learning, well-maintained but bearing the gentle patina of age and frequent use. No characters, hands, or other objects should appear in the image. ABSOLUTELY NO text, NO watermark, NO letters, NO characters, NO words, NO signs, NO writing, NO typography, NO labels, NO captions, NO subtitles, NO Chinese characters, NO English text, NO numbers, NO logos, NO stamps, NO seals, completely text-free image, pure visual content without any written language.
要求:生成的提示词必须确保视觉一致性,所有视角的道具比例、颜色、材质必须完全一致。场景中不得出现任何人物或道具,道具图中不得出现任何人物。图片中尽量不要出现文字、标识或任何书面语言。
4.7 图像生成调用
🔴 强制验证步骤(必须执行):
步骤1: 统计需要生成的场景数量 = N_locations, 道具数量 = N_props步骤2:IF N_locations >= 2:# 优先尝试4宫格批量生成调用函数 = "generate_4grid_location_images"IF N_locations < 4:补齐数量 = 4 - N_locationslocation_names = [实际场景列表] + ["placeholder"] * 补齐数量prompts = [实际提示词列表] + ["A pure black background image, solid black color, 16:9 aspect ratio, full height"] * 补齐数量# 顺序:Shot 1, Shot 2, Shot 3, Shot 4(先上排后下排)ELSE:location_names = [前4个场景]prompts = [对应提示词]ENDIF参数 = {location_names: location_names, prompts: prompts}# 如果4宫格生成失败,改用逐个生成IF 4宫格生成失败:记录失败原因FOR 每个场景:调用 generate_text_to_image() 单独生成ENDFORENDIFELSE IF N_locations == 1:调用函数 = "generate_text_to_image"处理单个场景ENDIFIF N_props >= 2:# 优先尝试4宫格批量生成调用函数 = "generate_4grid_prop_images"IF N_props < 4:补齐数量 = 4 - N_propsprop_names = [实际道具列表] + ["placeholder"] * 补齐数量prompts = [实际提示词列表] + ["A pure black background image, solid black color, 16:9 aspect ratio, full height"] * 补齐数量# 顺序:Shot 1, Shot 2, Shot 3, Shot 4(先上排后下排)ELSE:prop_names = [前4个道具]prompts = [对应提示词]ENDIF参数 = {prop_names: prop_names, prompts: prompts}# 如果4宫格生成失败,改用逐个生成IF 4宫格生成失败:记录失败原因FOR 每个道具:调用 generate_text_to_image() 单独生成ENDFORENDIFELSE IF N_props == 1:调用函数 = "generate_text_to_image"处理单个道具ENDIF步骤3: 执行调用
⚠️ 注意事项:
- ✅ 当 N_locations >= 2 或 N_props >= 2 时,优先使用4宫格批量生成
- ✅ 如果4宫格生成失败,允许降级为
generate_text_to_image()逐个生成 - ❌ 禁止未尝试4宫格就直接逐个生成
4宫格批量生成场景(当场景数量 >= 2 时的唯一正确方式):
- 调用
generate_4grid_location_images()函数(一站式解决方案) - 参数设置:
location_names: 4个名称的列表(必须是4个)- 如果实际场景<4个,用"placeholder"补齐
- 例如:2个场景 → ["场景1", "场景2", "placeholder", "placeholder"]
prompts: 4个提示词的列表(必须是4个)- 如果实际场景<4个,用"pure black background"补齐
- 例如:2个场景 → [提示词1, 提示词2, "pure black background", "pure black background"]
- 注意:生图模型由用户在前端界面选择,大模型无需关心具体使用哪个模型。
- 功能说明:
- 自动构建4宫格JSON格式
- 自动添加
image_size="4k"参数生成高分辨率图像 - 自动轮询等待图像生成完成(最多10分钟)
- 自动下载并切分4宫格图像为4个独立图像
- 自动更新每个场景的
reference_image字段 - 返回结果:
``json { "success": true, "message": "4宫格图像生成并切分完成", "project_id": "xxx", "grid_image_url": "原始4宫格图像URL", "locations": [ { "location": "场景1", "success": true, "image_url": "场景1的图像URL", "error": null }, ... ] } ``
4宫格批量生成道具(当道具数量 >= 2 时的唯一正确方式):
- 调用
generate_4grid_prop_images()函数(一站式解决方案) - 参数设置:
prop_names: 4个名称的列表(必须是4个)- 如果实际道具<4个,用"placeholder"补齐
- 例如:2个道具 → ["道具1", "道具2", "placeholder", "placeholder"]
prompts: 4个提示词的列表(必须是4个)- 如果实际道具<4个,用"pure black background"补齐
- 例如:2个道具 → [提示词1, 提示词2, "pure black background", "pure black background"]
- 注意:生图模型由用户在前端界面选择,大模型无需关心具体使用哪个模型。
- 功能说明:
- 自动构建4宫格JSON格式
- 自动添加
image_size="4k"参数生成高分辨率图像 - 自动轮询等待图像生成完成(最多10分钟)
- 自动下载并切分4宫格图像为4个独立图像
- 自动更新每个道具的
reference_image字段 - 返回结果:
``json { "success": true, "message": "4宫格图像生成并切分完成", "project_id": "xxx", "grid_image_url": "原始4宫格图像URL", "props": [ { "prop": "道具1", "success": true, "image_url": "道具1的图像URL", "error": null }, ... ] } ``
传统单个生成方式(仅当场景或道具数量 = 1 时使用):
- 调用
generate_text_to_image()函数 - 场景参数设置:
prompt: 单个场景的提示词item_type: 2 (场景类型)item_name: 场景名称force_update_exist_image: 仅在用户明确确认时才能设为true,否则必须为false- 道具参数设置:
prompt: 单个道具的提示词item_type: 3 (道具类型)item_name: 道具名称force_update_exist_image: 仅在用户明确确认时才能设为true,否则必须为false- 注意:生图模型由用户在前端界面选择,大模型无需关心具体使用哪个模型。
❌ 错误示例(禁止):
# 错误!未尝试4宫格就直接逐个生成:for location in ["场景1", "场景2"]:generate_text_to_image(item_name=location, item_type=2, ...) # ❌ 错误!应该先尝试4宫格# 错误!未尝试4宫格就直接逐个生成:for prop in ["道具1", "道具2"]:generate_text_to_image(item_name=prop, item_type=3, ...) # ❌ 错误!应该先尝试4宫格
✅ 正确示例(必须这样做):
# 正确!当有4个场景时,优先使用4宫格:result = generate_4grid_location_images(location_names=["场景1", "场景2", "场景3", "场景4"],prompts=[提示词1, 提示词2, 提示词3, 提示词4])# 如果4宫格失败,降级为逐个生成:if not result.get("success"):for location, prompt in zip(locations, prompts):generate_text_to_image(item_name=location, item_type=2, prompt=prompt)# ✅ 正确!# 正确!当有2个场景时(用占位符补齐):result = generate_4grid_location_images(location_names=["场景1", "场景2", "placeholder", "placeholder"],prompts=[提示词1, 提示词2, "pure black background", "pure black background"])if not result.get("success"):# 降级为逐个生成for location, prompt in [("场景1", 提示词1), ("场景2", 提示词2)]:generate_text_to_image(item_name=location, item_type=2, prompt=prompt)# ✅ 正确!# 正确!当有3个道具时(用占位符补齐):result = generate_4grid_prop_images(prop_names=["道具1", "道具2", "道具3", "placeholder"],prompts=[提示词1, 提示词2, 提示词3, "pure black background"])if not result.get("success"):# 降级为逐个生成for prop, prompt in [("道具1", 提示词1), ("道具2", 提示词2), ("道具3", 提示词3)]:generate_text_to_image(item_name=prop, item_type=3, prompt=prompt)# ✅ 正确!
4. 批量处理管理
- 为每个场景和道具记录生成状态(成功/失败/跳过)
- 统计处理结果:总数、成功数、失败数、跳过数
- 对于失败的项目,记录失败原因
- 提供完整的处理报告
5. 执行示例流程
完整工作流程示例:
- 获取项目列表:调用
list_location_jsons()和list_prop_jsons() - 分析每个项目:
``` 场景列表分析:
- 月影亭:有参考图像 ✓ (跳过)
- 藏书楼:无参考图像 ✗ (需要生成)
- 练武场:无参考图像 ✗ (需要生成)
- 竹林小径:无参考图像 ✗ (需要生成)
道具列表分析:
- 文士之笔:有参考图像 ✓ (跳过)
- 古籍残卷:无参考图像 ✗ (需要生成)
- 玉佩令牌:无参考图像 ✗ (需要生成)
- 铜镜:无参考图像 ✗ (需要生成)
- 茶具:无参考图像 ✗ (需要生成)
```
- 检查任务状态:
``` 任务状态检查:
- 藏书楼:无进行中任务 ✓ (可以处理)
- 练武场:无进行中任务 ✓ (可以处理)
- 竹林小径:无进行中任务 ✓ (可以处理)
- 古籍残卷:无进行中任务 ✓ (可以处理)
- 玉佩令牌:无进行中任务 ✓ (可以处理)
- 铜镜:无进行中任务 ✓ (可以处理)
- 茶具:有进行中任务 ✗ (跳过本次)
```
- 生成图像(根据数量选择方式):
情况A:场景数量 >= 2,道具数量 >= 2(使用4宫格批量生成) ``` 检测到需要生成3个场景,使用4宫格批量生成...
场景批次(3个场景,补齐1个占位符):
- 调用 generate_4grid_location_images()
- location_names: ["藏书楼", "练武场", "竹林小径", "placeholder"]
- prompts: [藏书楼提示词, 练武场提示词, 竹林小径提示词, "pure black background"]
- 等待生成完成(自动轮询)✓
- 自动切分并更新3个场景 ✓
检测到需要生成3个道具,使用4宫格批量生成...
道具批次(3个道具,补齐1个占位符):
- 调用 generate_4grid_prop_images()
- prop_names: ["古籍残卷", "玉佩令牌", "铜镜", "placeholder"]
- prompts: [古籍残卷提示词, 玉佩令牌提示词, 铜镜提示词, "pure black background"]
- 等待生成完成(自动轮询)✓
- 自动切分并更新3个道具 ✓
```
情况B:场景或道具数量 = 1(逐个生成) ``` 检测到需要生成1个场景,逐个生成...
开始为藏书楼生成场景图像...
- 读取场景信息 ✓
- 构建提示词 ✓
- 调用 generate_text_to_image() ✓
```
- 处理报告:
``` 批量处理完成:
- 总场景数:4,总道具数:5
- 已有图像:场景1个,道具1个
- 4宫格生成:场景3个(藏书楼、练武场、竹林小径),道具3个(古籍残卷、玉佩令牌、铜镜)
- 任务冲突:道具1个(茶具)
- 成功率:100%
```
提示词模板说明
场景必须保持的视觉区域
| 区域 | 必须包含内容 | 最低要求 | |
|---|---|---|---|
| Main Location View | 场景整体全景图 | 环境特征+建筑细节+氛围,无人物无道具 |
道具必须保持的1个视觉区域
| 区域 | 位置 | 必须包含内容 | 最低要求 | |
|---|---|---|---|---|
| Three-View Display | 水平排列 | 正面、侧面、背面视图 | 保持前后一致性,无人物,道具独立展示 |
场景道具特征到区域的详细映射
| 项目信息 | 映射到的区域 | 描述要点 | |
|---|---|---|---|
| 环境外观 | Main Location View | 必须在主视图中清晰展现 | |
| 材质颜色 | Color Palette | 列出具体颜色名称和材质特性 | |
| 结构细节 | Architectural Details | 展示重要的构造和装饰细节 | |
| 功能特点 | Usage Demonstrations | 转化为使用场景和操作方式 | |
| 空间布局 | Main Location View | 在全景图中展现空间布局和区域划分 |
注意事项
- 处理条件限制(最重要) - 仅处理同时满足以下两个条件的项目:
- 没有参考图像(
reference_image字段为空、null或不存在) - 没有进行中的图像生成任务(状态不为
processing、pending、in_progress)
- 强制更新权限限制(关键) -
force_update_exist_image参数使用规则:
- 默认必须为false - 保护现有图像不被意外覆盖
- 仅在用户明确确认时才能设为true - 必须得到用户明确授权才能覆盖现有图像
- 如果项目已有图像且未获得用户授权,必须跳过该项目并在报告中说明
- 🔴 画风严格遵循(极其重要) - 必须严格遵循世界设定中的画风要求,不得出现画风不匹配的情况:
- 必须首先调用
read_world()获取visual_style画风信息 - 在提示词最开头用明确的英文描述画风(如:Photorealistic style / Japanese anime style)
- 绝对禁止:要求写实却生成漫画风格,或要求漫画却生成写实风格
- 所有场景和道具必须使用完全相同的画风描述,确保整体视觉一致性
- 视觉一致性 - 确保所有视角的道具在比例、颜色、材质上完全一致,避免前后矛盾
- 纯净展示 - 场景中不得出现人物或道具,道具展示中不得出现人物或其他物品
- 项目名称一致性 - 确保所有函数调用中的场景和道具名称完全一致
- 任务冲突避免 - 必须检查任务状态,避免重复提交
- 错误处理 - 妥善处理场景道具不存在、任务冲突等异常情况
- 类型区分 - 严格区分场景(item_type=2)和道具(item_type=3)的处理流程
权限要求
read_world- 读取世界设定(获取画风信息)read_location_json- 读取场景信息read_prop_json- 读取道具信息list_location_jsons- 列出所有场景list_prop_jsons- 列出所有道具generate_text_to_image- 生成图像get_text_to_image_model_info- 获取生图模型算力信息get_task_status- 查询任务状态
输出格式
生成完成后提供简洁的状态报告:
- 场景道具信息读取状态
- 任务冲突检查结果
- 图像生成任务提交状态
- 预计完成时间(如果可用)