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

# 万相文生图

通义万相-文生图模型基于文本生成图像，支持多种艺术风格与写实摄影效果，满足多样化创意需求。

### 模型参数

* 模型ID：`wan2.6-t2i`/`wan2.5-t2i-preview`/`wanx2.1-t2i-plus`/`wanx2.1-t2i-turbo`/`wan2.2-t2i-flash`/`wan2.2-t2i-plus`
* 模型价格：你可以在[模型广场](https://geekai.co/models?platform=dashscope\&type=image)查看最新价格信息
* 调用入口：`https://geekai.co/api/v1/images/generations`
* 模型参数：参考[画图 API 手册](https://docs.geekai.co/cn/api/image/generations)
* API认证：[获取 API KEY](https://docs.geekai.co/cn/docs/quick_start)

<Note>
  不支持画图 API 中的以下参数：

  * `image`
  * `strength`
  * `aspect_ratio`
  * `quality`
  * `style_preset`
  * `response_format`
  * `output_format`
  * `mask`
  * `background`

  附：[万相文本生成图像 官方 API 文档](https://help.aliyun.com/zh/model-studio/text-to-image)
</Note>

万相2.6和万相2.5 可以通过 `size` 字段实现输出图像的分辨率，格式为宽x高：

常见推荐的分辨率及其对应的图像宽高比例为：

| 宽高比  | 像素值       |
| ---- | --------- |
| 1:1  | 1280x1280 |
| 4:3  | 1472x1104 |
| 3:4  | 1104x1472 |
| 16:9 | 1696x960  |
| 9:16 | 960x1696  |

总像素在 `[1280x1280, 1440x1440] `之间且宽高比范围为 `[1:4, 4:1]`

万相2.1和万相2.2 文生图模型支持的图像分辨率：宽高均在`[512, 1440]`像素之间，最大分辨率为`1440x1440`

可以通过`n`控制生成图片的数量。取值范围为1-4张

### 文生图

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "wan2.6-t2i",
    "prompt": "一间有着精致窗户的花店，漂亮的木质门，摆放着花朵",
    "size":"1280x1280",
    "negative_prompt": "低质量",
    "watermark": true,
    "n": 2
}'
```

响应是一个 JSON 对象，包含生成图片的 URL：

```json theme={null}
{
     "model": "wan2.6-t2i",
    "created": 1767754140,
    "task_id": "5a59c052-59e5-44a8-92f1-37a9571a8ab7",
    "task_status": "succeed",
    "data": [
        {
            "url": "https://static.geekai.co/image/2026/01/07/d4cb3902eb560fc70ddfe75af47a5f5f.png"
        },
        {
            "url": "https://static.geekai.co/image/2026/01/07/6bd717ed012ab02be2be779b07716b02.png"
        }
    ],
    "usage": {
        "billed_units": 2
    }
}
```
