跳转到内容
打开 Castaly控制台

图片

wan2.7-image-pro API

通过 Modelflare 使用 wan2.7-image-pro,使用本页显示的精确模型 ID。

使用精确模型 ID wan2.7-image-pro。请求中的模型名必须与本页完全一致。

水墨风海报:层叠云雾山峦之下,静水中的一叶孤舟。

示例输出wan2.7-image-proPOST /v1/images/generations

请求参数:size=2Kn=1

提示词:Modern poster in Chinese ink-wash style: layered misty mountains, a lone wooden boat on a still river, a single red seal-like accent, generous negative space, elegant and minimal, no text.

生成该示例的请求
{
"model": "wan2.7-image-pro",
"prompt": "Modern poster in Chinese ink-wash style: layered misty mountains, a lone wooden boat on a still river, a single red seal-like accent, generous negative space, elegant and minimal, no text.",
"n": 1,
"size": "2K"
}

使用 Modelflare API Key,通过 https://modelflare.dev/v1 发送请求。网关入口为 POST /v1/images/generations。

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
终端窗口bash
curl https://modelflare.dev/v1/images/generations \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-image-pro",
"prompt": "一只白猫在雨夜霓虹街道上奔跑",
"size": "1024x1024", "n": 1
}'

OpenAI 兼容图片模型使用 prompt、n、size、quality 等字段;编辑仅在官方页面明确支持时使用。

Wan2.7 Image / Pro 使用同步 Images API。简单请求可采用扁平 OpenAI 兼容结构;多图、区域编辑和组图生成使用 input.messages + parameters 的嵌套结构。Pro 的非组图文生图最高支持 4K,标准版最高支持 2K。

字段 必填 说明
model 是 wan2.7-image-pro
prompt 是 生图或编辑指令
image 否 单张图片 URL/Base64;多图使用 input.messages,最多 9 张
input.messages 否 多图、区域编辑和组图生成的嵌套消息
size 否 1K / 2K;Pro 非组图文生图支持 4K
n 否 非组图 1–4;组图 1–12;按成功生成数量计费
thinking_mode 否 无图片输入时的思考模式
watermark 否 是否添加水印
parameters.prompt_extend 否 提示词扩展,默认 true;
parameters.bbox_list 否 交互式区域编辑框
parameters.enable_sequential 否 是否启用连续生图
parameters.color_palette 否 3–10 个 HEX 色值及百分比;占比总和 100%

简单请求可使用扁平结构;多图、区域编辑和连续生图使用 input.messages 与 parameters。输入图片最多 9 张、单张不超过 20 MB,宽高 240–8,000 px,宽高比 1:8 至 8:1。非组图输出数量为 1–4,组图为 1–12;Pro 非组图文生图支持 4K,其他组合最高 2K。

Wan2.7 Image 同时支持简单扁平结构和嵌套 input.messages/parameters 结构;多图、区域编辑和组图使用嵌套结构。

多图编辑

终端窗口bash
curl https://modelflare.dev/v1/images/generations \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-image-pro",
"input": {"messages": [{"role": "user", "content": [
{"image": "https://example.com/person.png"},
{"image": "https://example.com/background.png"},
{"text": "将图 1 中的人物放入图 2 的场景中"}
]}], "parameters": {"size": "2K", "n": 1, "prompt_extend": true}}
}'

交互式区域编辑

终端窗口bash
curl https://modelflare.dev/v1/images/generations \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-image-pro", "input": {"messages": [{"role": "user", "content": [
{"image": "https://example.com/room.png"},
{"text": "将选中区域的花瓶替换成红玫瑰"}
]}], "parameters": {"size": "2K", "n": 1, "bbox_list": [[[420, 280, 760, 720]]]}}
}'

连贯组图

终端窗口bash
curl https://modelflare.dev/v1/images/generations \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-image-pro", "input": {"messages": [{"role": "user", "content": [{"text": "生成四张角色一致的季节分镜"}]}]},
"parameters": {"size": "2K", "enable_sequential": true, "n": 4, "watermark": false}
}'

参数不符合模型契约时,接口会返回带 request ID 的 4xx;响应字段和错误消息以当前模型接口为准。

本页只覆盖 Modelflare 的模型生成/编辑调用。搜索或地图增强、声音管理、元素库管理等资源型接口不属于本页的公开调用范围,也不需要作为模型请求字段传入。

本模型按次计费。请查看模型价格页查看当前销售价、参考原价和完整规格。

模型 ID 差异
wan2.7-image-pro 本页说明的模型。
媒体契约 · v1

契约 ID: media.wan2-7-image-pro.v1Adapter: image.wan.v1@v1指纹: 08e8d3ebc25a5736d78ee6137926a3e20722a57c491d12338a09ac1bf95b1ada

官方来源: Alibaba Cloud Model Studio

契约参数

Intent 字段控件选项
sizeselect1K / 2K / 4K
nnumber—

支持能力

  • allowed_values · size · 1K, 2K, 4K
  • max_assets · reference_asset_ids · 9

结构化请求示例

text

Intent

{
  "n": 1,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "size": "1K"
}

上游请求

{
  "model": "wan2.7-image-pro",
  "n": 1,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "size": "1K"
}

reference

Intent

{
  "n": 1,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "size": "1K"
}

上游请求

{
  "image": "https://example.com/reference.png",
  "model": "wan2.7-image-pro",
  "n": 1,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "size": "1K"
}