{
  "openapi": "3.0.0",
  "info": {
    "title": "AI 图片生成器",
    "description": "# 概览\n用我们创新的文生图工具，见识 AI 的能量！一句话即刻变成亮眼画面，提示词随您试，卡通、油画、素描等风格随您玩，把创意痛快释放出来。不论您是画家、设计师还是热爱创意的人，这套工具都能给足空间，把您脑海里的画面做出来。还能加入参考图，激发新的创作方向，由 AI 打磨成完全原创的作品。\n\n想要更多灵感？请参见 https://yce.makeupar.com/ai-art-generator。\n\n使用场景：\n![AI Image Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_v3_video_02f161f909.jpg \"AI Image Generator\")\n\n![AI Image Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_v4_poster_092d2fbb9f.jpg \"AI Image Generator\")\n\n输出示例：\n![AI Image Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_topbanner_dt_2_e325681588.jpg \"AI Image Generator\")\n\n![AI Image Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/text_to_image_topbanner_dt_5_8b4fa13c6a.jpg \"AI Image Generator\")\n\n## 文件规格与错误码\n\n* 支持的格式与尺寸\n\n|AI 功能|支持尺寸|支持文件大小|支持格式|\n| ---- | ---- | ---- | ---- |\n| V1.0 文生图 | 输出：长边 1024 像素。 | 提示词不得超过 500 个字符 | 不适用 |\n| V2.0 文生图 | 输出：默认分辨率 1664 × 928，支持 1664 × 928（16:9）、1472 × 1104（4:3）、1328 × 1328（1:1）、1104 × 1472（3:4）、928 × 1664（9:16）。 | 提示词不得超过 800 个字符 | 不适用 |\n| V2.0 图生图 | 输入：宽与高都须在 384 到 3072 像素之间。<br>输出：宽高可自行设定，范围 512 到 2,048 像素；默认设置的总像素约为 1,024 × 1,024，比例依输入图而定。 | <10MB<br> 提示词不得超过 800 个字符 | JPG、JPEG、PNG、BMP、TIFF、WEBP、GIF。<br>动图 GIF 仅处理第一帧。 |\n\n* 错误码\n\n| 错误码 | 说明 |\n| ---------- | ----------- |\n| exceed_max_filesize | 上传的文件大小超出上限。 |\n| invalid_parameter | 有参数缺失或取值无效 |\n| error_download_image | 下载原图失败。 |\n| error_decode_image | 解码或解析原图失败。 |\n| error_nsfw_content_detected | 在原图中检测到不适宜内容（NSFW）。 |\n| error_unsupport_ratio | 输入图片的宽高比不受支持。 |\n| unknown_internal_error | 发生未知的内部错误。 |\n\n---\n\n## 点数消耗\n\n| AI 功能 | 消耗点数 |\n|---|---|\n| AI 图片生成器 V1.0 | 2 |\n| AI 图片生成器 V2.0 | 1 |\n\n---\n",
    "version": "",
    "termsOfService": "https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api",
    "contact": {
      "email": "YouCamOnlineEditor_API@perfectcorp.com"
    },
    "license": {
      "name": "Privacy policy",
      "url": "https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api"
    }
  },
  "servers": [
    {
      "url": "https://yce-api-01.makeupar.com"
    }
  ],
  "tags": [
    {
      "name": "V2.0",
      "description": "借助 AI 图片生成器 V2.0 接口，用文字提示词或现有图片即可即时生成高质量图像，视觉表现、细节与一致性都有明显提升。"
    },
    {
      "name": "V1.0",
      "description": "AI 图片生成器接口支持用文字提示词搭配预置模板生成图片。"
    }
  ],
  "paths": {
    "/s2s/v2.0/task/template/text-to-image": {
      "get": {
        "summary": "列出预置模板。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "type": "integer",
              "example": 20
            },
            "description": "本页返回的条目数量，取值 1 到 20，默认 20。"
          },
          {
            "name": "starting_token",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "73a3c9e69b89"
            },
            "description": "本页的起始 token。第一页传 `null`， 之后用上一次响应里的 `next_token` 作为下一页的起点"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/TemplateResponse"
          },
          "400": {
            "$ref": "#/components/responses/InvalidParameters"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image": {
      "post": {
        "summary": "执行 AI 图片生成器 任务。",
        "description": "AI 任务是异步处理的。功能支持 Webhook 时，优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名，收到 `success` 或 `error` 通知后，用收到的 `task_id` 查询任务结果。配置与校验的细节请见 [Webhook 接入指南](/develop/webhook.md)。\n\n若功能不支持 Webhook，或您的接入方式用不了 Webhook，就请实现轮询。提交 AI 任务后，按固定间隔（例如每 10 秒）轮询状态接口，直到任务状态变为 `success` 或 `error`。\n",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "required": [
                      "prompt",
                      "template_id"
                    ],
                    "properties": {
                      "prompt": {
                        "type": "string",
                        "description": "生成图片的提示词",
                        "example": "A little cat"
                      },
                      "negative_prompt": {
                        "type": "string",
                        "description": "反向提示词（不想要的内容）",
                        "example": "dog"
                      },
                      "template_id": {
                        "type": "string",
                        "description": "模板 ID。请先调用列出预置模板的接口，再取用其中某个模板的 ID。",
                        "example": "good_template_001"
                      },
                      "steps": {
                        "type": "integer",
                        "description": "步数会影响画质与处理耗时。 <br> 步数建议 <br> 10-15 步：适合快速试提示词、做大幅调整。 <br> 15–20 步：社区常用的甜点区间，多数模型在这段能取得画质与耗时的最佳平衡。 <br> 20–30 步：适合生成细节丰富的主体，例如人脸、毛发、建筑元素。",
                        "example": 10
                      },
                      "cfg_scale": {
                        "type": "number",
                        "description": "CFG（Classifier-Free Guidance）强度决定了 AI 模型在多大程度上严格遵循您的文字提示词。 <br> 低 CFG（1–4）：AI 创作自由度很高，会宽松地解读提示词，容易出抽象、画意风格，甚至完全跑题的结果。 <br> 中 CFG（5–10）：理想区间。生成器紧贴您的描述，同时画面依然自然、高质量。 <br> 高 CFG（11+）：AI 会逐字贴合提示词。细节更锐利、更照字面，但调得过高常导致颜色过饱和、噪点与不自然的痕迹。",
                        "example": 4
                      },
                      "seed": {
                        "type": "array",
                        "description": "每张图片都用一个独立的随机种子生成。使用同一种子即可复现同一张图。只接受 1 个种子。",
                        "items": {
                          "type": "integer",
                          "example": 3843718472198472
                        }
                      },
                      "width_ratio": {
                        "type": "integer",
                        "description": "图片宽度比例。",
                        "example": 3
                      },
                      "height_ratio": {
                        "type": "integer",
                        "description": "图片高度比例。",
                        "example": 4
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务执行成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "任务执行失败",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image/{task_id}": {
      "get": {
        "summary": "查询 AI 图片生成器 任务的状态。",
        "tags": [
          "V1.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "要查询的任务 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image/youcam": {
      "post": {
        "summary": "执行 AI 图片生成器 V2（文字生成图片）任务。",
        "description": "AI 任务是异步处理的。功能支持 Webhook 时，优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名，收到 `success` 或 `error` 通知后，用收到的 `task_id` 查询任务结果。配置与校验的细节请见 [Webhook 接入指南](/develop/webhook.md)。\n\n若功能不支持 Webhook，或您的接入方式用不了 Webhook，就请实现轮询。提交 AI 任务后，按固定间隔（例如每 10 秒）轮询状态接口，直到任务状态变为 `success` 或 `error`。\n",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "type": "object",
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "模型名称。",
                        "enum": [
                          "youcam-image-v2"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 800,
                        "description": "正向提示词，描述您想要的画面内容、风格与构图。 <br>支持中英文，最长 800 字符。每个汉字、字母、数字、符号各计 1 字符。",
                        "example": "A sitting orange cat with a joyful expression, lively and adorable, highly realistic."
                      },
                      "negative_prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500,
                        "description": "反向提示词，描述您不希望出现在画面中的内容。 <br>支持中英文，最长 500 字符。",
                        "example": "Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces, AI-generated look. Chaotic composition. Blurry or distorted text."
                      },
                      "size": {
                        "type": "string",
                        "description": "输出图片分辨率，格式为 width\\*height。 <br> 支持的分辨率及其宽高比： <br>- 1664\\*928（默认）：16:9 <br>- 1472\\*1104：4:3 <br>- 1328\\*1328：1:1 <br>- 1104\\*1472：3:4 <br>- 928\\*1664：9:16",
                        "enum": [
                          "1664*928",
                          "1472*1104",
                          "1328*1328",
                          "1104*1472",
                          "928*1664"
                        ],
                        "example": "1664*928",
                        "default": "1664*928"
                      },
                      "prompt_extend": {
                        "type": "boolean",
                        "description": "开启智能改写提示词。模型会优化正向提示词，不影响反向提示词。",
                        "example": true,
                        "default": true,
                        "enum": [
                          true,
                          false
                        ],
                        "x-enumDescriptions": {
                          "true": "Enables rewriting. Use this for more diverse image content; the model adds details.",
                          "false": "Disables rewriting. Use this for tighter control over image details."
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务执行成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "任务执行失败",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/text-to-image/youcam/{task_id}": {
      "get": {
        "summary": "查询 AI 图片生成器 V2（文字生成图片）任务的状态。",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "要查询的任务 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    },
    "/s2s/v2.0/task/image-to-image/youcam": {
      "post": {
        "summary": "执行 AI 图片生成器 V2（图生图）任务。",
        "description": "AI 任务是异步处理的。功能支持 Webhook 时，优先用 Webhook 来接收完成通知。配置好您的 Webhook 端点、校验 Webhook 签名，收到 `success` 或 `error` 通知后，用收到的 `task_id` 查询任务结果。配置与校验的细节请见 [Webhook 接入指南](/develop/webhook.md)。\n\n若功能不支持 Webhook，或您的接入方式用不了 Webhook，就请实现轮询。提交 AI 任务后，按固定间隔（例如每 10 秒）轮询状态接口，直到任务状态变为 `success` 或 `error`。\n",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "anyOf": [
                      {
                        "title": "以多张 src_file_urls 运行任务",
                        "type": "object",
                        "required": [
                          "src_file_urls"
                        ],
                        "properties": {
                          "src_file_urls": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 3,
                            "description": "取自上传文件接口的文件 URL。请提供 src_file_urls 或 src_file_ids 二者之一。",
                            "example": [
                              "https://example.com/selfie.jpg",
                              "https://example.com/selfie.jpg",
                              "https://example.com/selfie.jpg"
                            ],
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      {
                        "title": "用三个角度的源文件 ID 运行任务",
                        "type": "object",
                        "required": [
                          "src_file_ids"
                        ],
                        "properties": {
                          "src_file_ids": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 3,
                            "description": "取自上传文件接口的文件 ID。请提供 src_file_urls 或 src_file_ids 二者之一。",
                            "example": [
                              "pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=",
                              "pkVzplMv8Y1QPgHbqtKfyJmg+xJDUbTP16YijZ3qARNf",
                              "B5LNohvvO+7d/78Ymuhp6vMiSooN/5DX9oVuupzkKctf"
                            ],
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    ]
                  },
                  {
                    "type": "object",
                    "required": [
                      "model",
                      "prompt"
                    ],
                    "properties": {
                      "model": {
                        "type": "string",
                        "description": "模型名称。",
                        "enum": [
                          "youcam-image-v2"
                        ]
                      },
                      "prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 800,
                        "description": "图片编辑指令（正向提示词），描述您希望在生成图片中出现的元素与视觉特征。 <br>支持中英文，最长 800 字符，每个汉字或英文字母计 1 字符。",
                        "example": "Make the girl from Image 1 wear the black dress from Image 2 and sit in the pose from Image 3. Keep her clothing, hairstyle, and expression unchanged, and ensure the action is natural and smooth."
                      },
                      "negative_prompt": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500,
                        "description": "反向提示词，描述您不希望出现在生成图片中的内容。 <br>支持中英文，最长 500 字符，每个汉字或英文字母计 1 字符。",
                        "example": "low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions."
                      },
                      "size": {
                        "type": "string",
                        "description": "以 width*height 格式指定输出图片分辨率，例如 \"1024\\*1536\"。 <br>- 宽与高都须落在 [512, 2048] 像素之间。 <br>- 默认总像素约为 1024\\*1024，宽高比接近输入图片（多图请求时以最后一张为准）。 <br>指定 size 参数后，系统会以 size 给出的宽高为目标，把实际输出图片的宽高调整为最接近的 16 的倍数。例如指定 1033\\*1032，输出尺寸为 1040\\*1024。 <br>常用宽高比的推荐分辨率： <br>- 1:1：1024\\*1024、1536\\*1536 <br>- 2:3：768\\*1152、1024\\*1536 <br>- 3:2：1152\\*768、1536\\*1024 <br>- 3:4：960\\*1280、1080\\*1440 <br>- 4:3：1280\\*960、1440\\*1080 <br>- 9:16：720\\*1280、1080\\*1920 <br>- 16:9：1280\\*720、1920\\*1080 <br>- 21:9：1344\\*576、2048\\*872",
                        "example": "1024*1024"
                      },
                      "prompt_extend": {
                        "type": "boolean",
                        "description": "开启智能改写提示词。模型会优化正向提示词，不影响反向提示词。",
                        "example": true,
                        "default": true,
                        "enum": [
                          true,
                          false
                        ],
                        "x-enumDescriptions": {
                          "true": "Enables rewriting. Use this for more diverse image content; the model adds details.",
                          "false": "Disables rewriting. Use this for tighter control over image details."
                        }
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务执行成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BasicRunTaskResponseV2"
                }
              }
            }
          },
          "400": {
            "description": "任务执行失败",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/RunError"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/s2s/v2.0/task/image-to-image/youcam/{task_id}": {
      "get": {
        "summary": "查询 AI 图片生成器 V2（图生图）任务的状态。",
        "tags": [
          "V2.0"
        ],
        "security": [
          {
            "BearerAuthenticationV2": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
            },
            "description": "要查询的任务 ID"
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态查询成功",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskStatusResponseV2"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidTaskId"
          },
          "401": {
            "$ref": "#/components/responses/InvalidApiKey"
          },
          "500": {
            "$ref": "#/components/responses/TaskTimeout"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuthenticationV2": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用标准的 Bearer 鉴权。把您的 API 密钥放进请求头： `Authorization:Bearer YOUR_API_KEY`。请注意 'Bearer' 与 'YOUR_API_KEY' 之间有一个空格。"
      }
    },
    "schemas": {
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "模板的 ID。运行任务时把它作为 `template_id` 使用。",
            "example": "good_template_001"
          },
          "thumb": {
            "type": "string",
            "description": "风格缩略图。"
          },
          "title": {
            "type": "string",
            "description": "模板名称。"
          },
          "category_name": {
            "type": "string",
            "description": "模板的类别名称。"
          }
        }
      },
      "BasicRunTaskResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "响应状态",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "该任务的 ID。凭这个 ID 可在 24 小时内查询任务结果。",
                "example": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe"
              }
            }
          }
        }
      },
      "RunError": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "响应状态",
            "example": 400
          },
          "error": {
            "type": "string",
            "description": "错误信息",
            "example": "The operation could not be completed"
          },
          "error_code": {
            "type": "string",
            "enum": [
              "InvalidParameters",
              "CreditInsufficiency",
              "InvalidStyleGroup",
              "InvalidStyle",
              "BadRequest"
            ],
            "description": "错误码：\n  * InvalidParameters - 请求参数无效\n  * CreditInsufficiency - 点数不足，无法运行\n  * BadRequest - 请求参数不符合预期\n  * InvalidStyleGroup - 风格分组 ID 无效\n  * InvalidStyle - 风格 ID 无效\n"
          }
        }
      },
      "EngineErrorCode": {
        "type": "string",
        "nullable": true,
        "enum": [
          "error_exceed_max_image_size",
          "exceed_max_filesize",
          "invalid_parameter",
          "error_download_image",
          "error_download_mask",
          "error_decode_image",
          "error_decode_mask",
          "error_nsfw_content_detected",
          "error_no_face",
          "error_pose",
          "error_face_parsing",
          "error_inference",
          "exceed_nsfw_retry_limits",
          "error_upload",
          "unknown_internal_error"
        ],
        "description": "错误码：\n- \\`error_exceed_max_image_size\\`  - 输入图片尺寸超出上限\n- \\`exceed_max_filesize\\` - 输入文件大小超出上限\n- \\`invalid_parameter\\` - 参数取值无效\n- \\`error_download_image\\` - 下载原图出错\n- \\`error_download_mask\\` - 下载蒙版图片出错\n- \\`error_decode_image\\` - 解码原图出错\n- \\`error_decode_mask\\` - 解码蒙版图片出错\n- \\`error_nsfw_content_detected\\` - 在原图中检测到不适宜内容（NSFW）\n- \\`error_no_face\\` - 原图中没有检测到人脸\n- \\`error_pose\\` - 原图的姿态检测失败\n- \\`error_face_parsing\\` - 原图的人脸分割失败\n- \\`error_inference\\` - 推理流程中出现错误\n- \\`exceed_nsfw_retry_limits\\` - 为避免生成不适宜内容， 重试次数已用尽\n- \\`error_upload\\` - 上传结果图片出错\n- \\`unknown_internal_error\\` - 其他错误\n"
      },
      "TaskStatusResponseBodySingleUrlResultsV2": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "下载该结果的 URL，有效期 2 小时",
            "example": "https://example.com/sample-result-url"
          }
        }
      },
      "TaskStatusResponseV2": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "description": "响应状态",
            "example": 200
          },
          "data": {
            "type": "object",
            "properties": {
              "task_status": {
                "type": "string",
                "enum": [
                  "running",
                  "success",
                  "error"
                ],
                "description": "任务状态"
              },
              "error": {
                "$ref": "#/components/schemas/EngineErrorCode"
              },
              "error_message": {
                "type": "string",
                "description": "错误的详细说明"
              },
              "results": null
            }
          }
        },
        "$ref": "#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2"
      }
    },
    "responses": {
      "TemplateResponse": {
        "description": "成功获取风格列表",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "description": "响应状态",
                  "example": 200
                },
                "data": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    },
                    "next_token": {
                      "type": "string",
                      "example": "73a3c9e69b89",
                      "description": "用于查询下一页的 token。"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "InvalidParameters": {
        "description": "请求参数无效",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid parameter value"
                },
                "error_code": {
                  "type": "string",
                  "example": "InvalidParameters"
                }
              }
            }
          }
        }
      },
      "InvalidApiKey": {
        "description": "API 密钥无效或缺失",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 401,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid API key"
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "请求过多",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 429,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Too many requests"
                }
              }
            }
          }
        }
      },
      "InvalidTaskId": {
        "description": "任务 ID 无效",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 400,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Invalid task ID"
                }
              }
            }
          }
        }
      },
      "TaskTimeout": {
        "description": "任务执行超时",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "integer",
                  "example": 500,
                  "description": "响应状态"
                },
                "error": {
                  "type": "string",
                  "example": "Task execution timed out"
                }
              }
            }
          }
        }
      }
    }
  }
}