# Seedream 5.0 Pro Global 图像生成

> 图像生成

根据提示词生成图像。Seedream 5.0 Pro Global 支持:
- 单图生成（不支持组图/连续生成）
- 最多 10 张参考图
- 图层分解模式
- 透明背景输出
- 多语言提示词

## 请求地址

`POST https://api.modelverse.cn/images/generations`

## 请求体

## 响应

- **200** — 图像生成响应。
- **400** — 请求参数无效或图像生成错误。
- **default** — 错误响应。

## OpenAPI 定义

```json
{
  "openapi": "3.1.0",
  "x-language": "zh-CN",
  "info": {
    "title": "Seedream 5.0 Pro Global 图像生成 API",
    "version": "1.0.0",
    "description": "Seedream 5.0 Pro Global 模型的图像生成 API。\n接口地址: POST https://api.modelverse.cn/v1/images/generations\n\n模型能力:\n- 仅支持单图生成\n- 最多支持 10 张参考图\n- 支持多语言提示词: 中文、英文、俄文、阿拉伯文、菲律宾文、泰文、土耳其文、韩文、马来文、西班牙文、葡萄牙文、印尼文、法文、德文、越南文、日文\n- 支持图层分解和透明背景\n- 不支持: 连续组图生成、流式输出、联网搜索工具\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn/v1",
      "description": "ModelVerse API endpoint for Seedream 5.0 Pro Global."
    }
  ],
  "tags": [
    {
      "name": "doubao-seedream-5-0-pro-260628-global",
      "description": "使用 Seedream 5.0 Pro (doubao-seedream-5-0-pro-260628-global) 进行图像生成。"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/images/generations": {
      "post": {
        "tags": [
          "doubao-seedream-5-0-pro-260628-global"
        ],
        "operationId": "createSeedream50ProGlobalImageGeneration",
        "summary": "Seedream 5.0 Pro Global 图像生成",
        "description": "根据提示词生成图像。Seedream 5.0 Pro Global 支持:\n- 单图生成（不支持组图/连续生成）\n- 最多 10 张参考图\n- 图层分解模式\n- 透明背景输出\n- 多语言提示词\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Seedream50ProGlobalGenerationRequest"
              },
              "examples": {
                "basicGeneration": {
                  "summary": "基础图像生成",
                  "value": {
                    "model": "doubao-seedream-5-0-pro-260628-global",
                    "prompt": "海边金色云霞的美丽日落",
                    "size": "2k",
                    "response_format": "url",
                    "watermark": false
                  }
                },
                "withReferenceImage": {
                  "summary": "使用参考图生成",
                  "value": {
                    "model": "doubao-seedream-5-0-pro-260628-global",
                    "prompt": "将图片转换为铅笔素描风格",
                    "images": [
                      "data:image/png;base64,iVBORw0KGgo..."
                    ],
                    "size": "2048x2048",
                    "output_format": "png",
                    "response_format": "url",
                    "watermark": false
                  }
                },
                "layerDecomposition": {
                  "summary": "图层分解模式",
                  "value": {
                    "model": "doubao-seedream-5-0-pro-260628-global",
                    "prompt": "将此图片分解为可编辑图层",
                    "images": [
                      "https://example.com/image.png"
                    ],
                    "size": "2k",
                    "layer_decomposition": true,
                    "output_format": "png",
                    "response_format": "url"
                  }
                },
                "transparentBackground": {
                  "summary": "透明背景生成",
                  "value": {
                    "model": "doubao-seedream-5-0-pro-260628-global",
                    "prompt": "一个可爱的卡通角色",
                    "images": [
                      "data:image/png;base64,iVBORw0KGgo..."
                    ],
                    "size": "2k",
                    "background": "transparent",
                    "output_format": "png",
                    "response_format": "url"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "图像生成响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seedream50ProGlobalGenerationResponse"
                },
                "examples": {
                  "urlImage": {
                    "summary": "返回 URL 格式的生成图像",
                    "value": {
                      "model": "doubao-seedream-5-0-pro-260628-global",
                      "created": 1767939740,
                      "data": [
                        {
                          "url": "https://xxxxxx",
                          "size": "2048x2048"
                        }
                      ],
                      "usage": {
                        "generated_images": 1,
                        "output_tokens": 16384,
                        "total_tokens": 16384
                      }
                    }
                  },
                  "base64Image": {
                    "summary": "返回 Base64 格式的生成图像",
                    "value": {
                      "model": "doubao-seedream-5-0-pro-260628-global",
                      "created": 1767939740,
                      "data": [
                        {
                          "b64_json": "{image_base64_string}",
                          "size": "2048x2048"
                        }
                      ],
                      "usage": {
                        "generated_images": 1,
                        "output_tokens": 16384,
                        "total_tokens": 16384
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求参数无效或图像生成错误。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seedream50ProGlobalErrorResponse"
                },
                "examples": {
                  "invalidParameter": {
                    "summary": "参数无效错误",
                    "value": {
                      "error": {
                        "code": "invalid_parameter",
                        "message": "该模型不支持 'stream' 参数。"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Seedream50ProGlobalErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "BytePlus API 密钥，通过 `Authorization: Bearer <API_KEY>` 请求头发送。\n"
      }
    },
    "schemas": {
      "Seedream50ProGlobalGenerationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "prompt"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "doubao-seedream-5-0-pro-260628-global",
            "description": "模型 ID。Seedream 5.0 Pro Global 必须使用 `doubao-seedream-5-0-pro-260628-global`。\n"
          },
          "prompt": {
            "type": "string",
            "minLength": 1,
            "description": "用于生成图像的文本提示词。\n\n语言支持: 中文、英文、俄文、阿拉伯文、菲律宾文、泰文、土耳其文、韩文、马来文、西班牙文、葡萄牙文、印尼文、法文、德文、越南文、日文。\n\n长度建议: 不超过 300 个中文字符或 600 个英文单词。\n"
          },
          "images": {
            "type": "array",
            "description": "参考图像输入（最多 10 张）。每项可以是可访问的 URL 或 Base64 数据 URL。\n",
            "items": {
              "type": "string"
            },
            "maxItems": 10
          },
          "image": {
            "type": "string",
            "description": "单个参考图像输入。可以是可访问的 URL 或 Base64 数据 URL。\n"
          },
          "layer_decomposition": {
            "type": "boolean",
            "default": false,
            "description": "启用图层分解模式。"
          },
          "size": {
            "type": "string",
            "description": "图像尺寸（2K、4K 或显式 WxH）。",
            "default": "2048x2048"
          },
          "optimize_prompt_options": {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "standard",
                  "fast"
                ],
                "default": "standard"
              }
            }
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ],
            "default": "jpeg"
          },
          "background": {
            "type": "string",
            "enum": [
              "transparent",
              "opaque"
            ],
            "default": "opaque",
            "description": "控制透明背景输出。"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "url",
              "b64_json"
            ],
            "default": "url"
          },
          "watermark": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "Seedream50ProGlobalGenerationResponse": {
        "type": "object",
        "required": [
          "model",
          "created",
          "data",
          "usage"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "created": {
            "type": "integer",
            "format": "int64"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Seedream50ProGlobalImageData"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Seedream50ProGlobalUsage"
          }
        }
      },
      "Seedream50ProGlobalImageData": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "b64_json": {
            "type": "string"
          },
          "size": {
            "type": "string"
          }
        }
      },
      "Seedream50ProGlobalUsage": {
        "type": "object",
        "required": [
          "generated_images",
          "output_tokens",
          "total_tokens"
        ],
        "properties": {
          "generated_images": {
            "type": "integer",
            "description": "生成的图像数量。"
          },
          "input_images": {
            "type": "integer",
            "description": "输入的图像数量。"
          },
          "output_tokens": {
            "type": "integer",
            "description": "输出的 token 数量。"
          },
          "total_tokens": {
            "type": "integer",
            "description": "总 token 数量（输入 + 输出）。"
          }
        }
      },
      "Seedream50ProGlobalErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Seedream50ProGlobalError"
          }
        }
      },
      "Seedream50ProGlobalError": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}
```
