> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maxapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 文本生成图片

> Seedream 文生图 — 通过文字描述生成图片

使用 Seedream 图片模型，通过 prompt 生成图片。支持 3 个模型版本。

### 可用模型

`seedream-5-lite` · `seedream-4.5` · `seedream-4`

<ParamField body="model" type="string" required>
  模型名称，如 `seedream-4.5`、`seedream-5-lite`。
</ParamField>

<ParamField body="callBackUrl" type="string">
  Webhook 回调地址。
</ParamField>

<ParamField body="input" type="object" required>
  <Expandable title="properties" defaultOpen>
    <ParamField body="prompt" type="string" required>
      提示词，描述你想生成的图片内容。
    </ParamField>

    <ParamField body="ratio" type="string">
      图片比例。可选值：`1:1`、`4:3`、`3:4`、`16:9`、`9:16`、`3:2`、`2:3`、`21:9`。
    </ParamField>

    <ParamField body="resolution" type="string">
      分辨率。可选值：`1k`、`2k`、`4k`。
    </ParamField>

    <ParamField body="n" type="integer">
      生成图片数量，默认 `1`。按 `n` 线性扣费。

      * `seedream-5-lite`：1–4
      * `seedream-4` / `seedream-4.5`：1–15
    </ParamField>
  </Expandable>
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.maxapi.io/api/v1/task/submit \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
    "model": "seedream-4.5",
    "callBackUrl": "https://example.com/webhook",
    "input": {
      "prompt": "赛博朋克风格的东京街景",
      "ratio": "16:9",
      "resolution": "2k"
    }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 提交成功 theme={null}
  {
    "code": 0,
    "msg": "ok",
    "data": {
      "taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad"
    }
  }
  ```
</ResponseExample>

***

## 查询结果

通过 [Query Task](/api-reference/query-task) 接口或 Webhook 获取生成结果：

```json theme={null}
{
  "code": 0,
  "msg": "ok",
  "data": {
    "taskId": "9db7d1ed-d1e5-4d11-9f3a-61f653b905ad",
    "status": "SUCCESS",
    "input": {
      "model": "seedream-4.5",
      "prompt": "赛博朋克风格的东京街景",
      "ratio": "16:9",
      "resolution": "2k"
    },
    "result": {
      "type": "image",
      "urls": [
        "https://example.com/output/image1.png",
        "https://example.com/output/image2.png",
        "https://example.com/output/image3.png",
        "https://example.com/output/image4.png"
      ]
    },
    "created_at": "2026-02-10T21:54:46.686768Z",
    "updated_at": "2026-02-10T21:55:04.039815Z"
  }
}
```

<Note>
  图片生成通常返回多张图片。`result` 仅在 `status` 为 `SUCCESS` 时有值。
</Note>
