创建时间: 2026-06-26 17:49 | 步骤: 4 个
基于用户上传的提示词和可选参考图,通过意图解析与参数校验、模板规则构建、高清图像生成及状态轮询,生成包含4种风格的4宫格文创设计效果图,并输出最终构图提示词供核查。
{
"workflow_id": "cultural_design_4grid_generation",
"input": {
"grid_num": {
"field_name": "grid_num",
"default": 4,
"description": "画面排版宫格数量,仅支持固定值:1、2、3、4,异常时系统兜底为4",
"example": 4,
"required": true,
"type": "integer"
},
"image": {
"field_name": "image",
"default": "",
"description": "用户上传的参考图图片,传入标准 Base64 编码字符串(或普通 URL),若为空则采用无图模板分支",
"example": "",
"required": false,
"type": "base64"
},
"prompt": {
"field_name": "prompt",
"default": "",
"description": "用户提示词,描述文创设计的核心主题",
"example": "昆明滇池湿地公园",
"required": false,
"type": "string"
},
"aspect_ratio": {
"field_name": "aspect_ratio",
"default": "1:1",
"description": "图像宽高比,可选值:1:1、3:4、4:3、16:9、9:16",
"example": "1:1",
"required": false,
"type": "string"
}
},
"steps": [
{
"point_code": "",
"id": "step_1_intent_analyzer",
"result": [],
"backend_type": "prompt_api",
"api_code": "intent_analyzer",
"status": "PENDING",
"name": "意图与参数校验解析",
"action": "run",
"params": {
"provided_params": {
"grid_num": "{{@input.grid_num}}",
"image": "{{@input.image}}",
"prompt": "{{@input.prompt}}",
"aspect_ratio": "{{@input.aspect_ratio}}"
},
"raw_requirement": "生成文创设计图"
}
},
{
"point_code": "",
"id": "step_2_prompt_template_builder",
"result": [],
"backend_type": "prompt_api",
"api_code": "prompt_template_builder",
"status": "PENDING",
"name": "提示词模板规则构建",
"action": "run",
"params": {
"image_status": "{{@step_1_intent_analyzer.result.data.validated_params.image_status}}",
"validated_prompt": "{{@step_1_intent_analyzer.result.data.validated_params.prompt}}",
"validated_grid_num": "{{@step_1_intent_analyzer.result.data.validated_params.grid_num}}"
},
"depends_on": [
"step_1_intent_analyzer"
]
},
{
"point_code": "1",
"id": "step_3_generate_image",
"result": [],
"backend_type": "sys_api",
"api_code": "3373",
"status": "PENDING",
"name": "启动图像生成任务",
"action": "run",
"params": {
"referImages": "{{@input.image}}",
"prompt": "{{@step_2_prompt_template_builder.result.data.result}}",
"aspect_ratio": "{{@step_1_intent_analyzer.result.data.validated_params.aspect_ratio}}"
},
"depends_on": [
"step_2_prompt_template_builder"
]
},
{
"point_code": "",
"id": "step_4_poll_image_status",
"result": [],
"backend_type": "sys_api",
"api_code": "polling",
"status": "PENDING",
"name": "轮询图像生成状态",
"action": "run",
"params": {
"result_url": "{{@step_3_generate_image.result.data.result_url}}"
},
"depends_on": [
"step_3_generate_image"
],
"polling": {
"interval_seconds": 5,
"timeout_seconds": 600,
"success_condition": "{{@step_4_poll_image_status.result.data.task_status}} === 'SUCCEEDED'"
}
}
],
"output": {
"task_id": {
"field_name": "task_id",
"description": "图像生成任务的唯一标识",
"value": "{{@step_3_generate_image.result.data.task_id}}",
"type": "string"
},
"final_composition_prompt": {
"field_name": "final_composition_prompt",
"description": "最终构建的纯文本构图提示词,供核查规则执行情况",
"value": "{{@step_2_prompt_template_builder.result.data.result}}",
"type": "string"
},
"result_image_url": {
"field_name": "result_image_url",
"description": "生成的文创效果图URL",
"value": "{{@step_4_poll_image_status.result.data.result_url}}",
"type": "string"
}
}
} 提交后立即返回 task_id,系统每 2 秒自动轮询一次运行状态并可视化工作流步骤,适合耗时较长的工作流。
grid_num必填integer画面排版宫格数量,仅支持固定值:1、2、3、4,异常时系统兜底为4
imagebase64用户上传的参考图图片,传入标准 Base64 编码字符串(或普通 URL),若为空则采用无图模板分支
promptstring用户提示词,描述文创设计的核心主题
aspect_ratiostring图像宽高比,可选值:1:1、3:4、4:3、16:9、9:16
task_id,再轮询查询任务状态与结果。下方按调用顺序列出两个端点。 https://route.showapi.com/flow/execute/6a3e3e4d3c51f24622002e73?appKey={AppKey}modestring必填async 异步(工作流仅支持异步调用) https://route.showapi.com/flow/task/query/{task_id}?appKey={AppKey}执行中途出错时
status 返回 FAILED, remark 给出错误信息; step_status_list 仅包含已执行到的部分阶段, output 为已产出的部分结果(可能为空或不完整)。
所有 API 响应均使用平台统一封装,业务数据嵌套在 showapi_res_body 中

7*24小时服务
保证您的售后无忧

1v1专属服务
保证服务质量

担保交易
全程担保交易保证资金安全

服务全程监管
全周期保证商品服务质量
© 2015-2023 WWW.SHOWAPI.COM ALL RIGHTS RESERVED.昆明秀派科技有限公司
本网站所列接口及文档全部由SHOWAPI网站提供,并对其拥有最终解释权 POWERED BY SHOWAPI