通义万相2.7-图像生成与编辑-Pro(同步任务)
ali/wan2.7-image-pro — 阿里通义万相 Wan2.7 图像生成与编辑 Pro:与标准版同协议,面向更高画质要求的文生图、多图编辑、交互式编辑与组图生成场景。
同步任务:/v1/images/generations、/v1/images/edits,直接返回结果。
https://router.shengsuanyun.com/apiAuthorization: Bearer YOUR_API_KEY端点列表
POST/v1/images/generationsAli 图像生成-同步
阿里通义万相 Wan2.7 图像生成与编辑 Pro:与标准版同协议,面向更高画质要求的文生图、多图编辑、交互式编辑与组图生成场景。。同步接口:直接返回生成结果。
请求体
application/json
| 字段 | 类型 | 说明 | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
input必填 | object | 展开结构
| ||||||||||||||||||||||||||||||||||||
parameters | object | 展开结构
| ||||||||||||||||||||||||||||||||||||
model必填 | string | 路由模型,本页固定为 ali/wan2.7-image-pro |
{
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "一间有着精致窗户的花店,漂亮的木质门,摆放着花朵"
}
]
}
]
},
"parameters": {
"size": "2K",
"n": 1,
"watermark": false,
"thinking_mode": true
},
"model": "ali/wan2.7-image-pro"
}请求示例
参考地址:https://router.shengsuanyun.com/api。路径参数与凭据需替换;非 JSON 请求体需按对应格式准备。
curl -X POST 'https://router.shengsuanyun.com/api/v1/images/generations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data '{
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "一间有着精致窗户的花店,漂亮的木质门,摆放着花朵"
}
]
}
]
},
"parameters": {
"size": "2K",
"n": 1,
"watermark": false,
"thinking_mode": true
},
"model": "ali/wan2.7-image-pro"
}'响应
200 成功
application/json
未提供结构定义。
{
"output": {
"choices": [
{
"finish_reason": "stop",
"message": {
"content": [
{
"image": "https://dashscope-xxx.oss-xxx.aliyuncs.com/xxx.png?Expires=xxx",
"type": "image"
}
],
"role": "assistant"
}
}
],
"finished": true
},
"usage": {
"image_count": 1,
"input_tokens": 10867,
"output_tokens": 2,
"size": "1488*704",
"total_tokens": 10869
},
"request_id": "71dfc3c6-f796-9972-97e4-bc4efc4faxxx"
}400 请求参数错误
application/json
未提供结构定义。
{
"error": {
"message": "Invalid request parameters.",
"type": "invalid_request_error",
"param": "parameters.size",
"code": "InvalidParameter"
}
}401 鉴权失败(API Key 无效)
application/json
未提供结构定义。
{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}429 请求过于频繁
application/json
未提供结构定义。
{
"error": {
"message": "Rate limit reached.",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded"
}
}500 上游服务或内部错误
application/json
未提供结构定义。
{
"error": {
"message": "Upstream provider error.",
"type": "server_error",
"param": null,
"code": "upstream_error"
}
}POST/v1/images/editsAli 图像编辑-同步
阿里通义万相 Wan2.7 图像生成与编辑 Pro:与标准版同协议,面向更高画质要求的文生图、多图编辑、交互式编辑与组图生成场景。。同步图像编辑接口:直接返回编辑结果。
请求体
application/json
| 字段 | 类型 | 说明 | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
input必填 | object | 展开结构
| ||||||||||||||||||||||||||||||||||||
parameters | object | 展开结构
| ||||||||||||||||||||||||||||||||||||
model必填 | string | 路由模型,本页固定为 ali/wan2.7-image-pro |
{
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "一间有着精致窗户的花店,漂亮的木质门,摆放着花朵"
}
]
}
]
},
"parameters": {
"size": "2K",
"n": 1,
"watermark": false,
"thinking_mode": true
},
"model": "ali/wan2.7-image-pro"
}请求示例
参考地址:https://router.shengsuanyun.com/api。路径参数与凭据需替换;非 JSON 请求体需按对应格式准备。
curl -X POST 'https://router.shengsuanyun.com/api/v1/images/edits' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data '{
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "一间有着精致窗户的花店,漂亮的木质门,摆放着花朵"
}
]
}
]
},
"parameters": {
"size": "2K",
"n": 1,
"watermark": false,
"thinking_mode": true
},
"model": "ali/wan2.7-image-pro"
}'响应
200 成功
application/json
未提供结构定义。
{
"output": {
"choices": [
{
"finish_reason": "stop",
"message": {
"content": [
{
"image": "https://dashscope-xxx.oss-xxx.aliyuncs.com/xxx.png?Expires=xxx",
"type": "image"
}
],
"role": "assistant"
}
}
],
"finished": true
},
"usage": {
"image_count": 1,
"input_tokens": 10867,
"output_tokens": 2,
"size": "1488*704",
"total_tokens": 10869
},
"request_id": "71dfc3c6-f796-9972-97e4-bc4efc4faxxx"
}400 请求参数错误
application/json
未提供结构定义。
{
"error": {
"message": "Invalid request parameters.",
"type": "invalid_request_error",
"param": "parameters.size",
"code": "InvalidParameter"
}
}401 鉴权失败(API Key 无效)
application/json
未提供结构定义。
{
"error": {
"message": "Invalid API key.",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}429 请求过于频繁
application/json
未提供结构定义。
{
"error": {
"message": "Rate limit reached.",
"type": "rate_limit_error",
"param": null,
"code": "rate_limit_exceeded"
}
}500 上游服务或内部错误
application/json
未提供结构定义。
{
"error": {
"message": "Upstream provider error.",
"type": "server_error",
"param": null,
"code": "upstream_error"
}
}