跳转到内容
打开 Castaly控制台

图片

wan2.7-image API

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

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

酒店走廊的地毯在绯红缎面外套的女性身后卷起,变成带着花纹的飘带。

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

请求参数:size=1536x1024n=1

提示词:A long hotel corridor with a heavily patterned carpet, doors receding into the distance. A woman in a floor-length crimson satin coat has just taken one step forward. Behind her heel the carpet pattern has started to peel up off the floor, lifting away as loose ribbons of colour that keep the print exactly and curl into the air down the length of the hall. One hard green exit sign above, warm wall sconces along the corridor. Wide low camera on the floor line, deep perspective, real cloth weight, film grain, slight vignette, no text.

生成该示例的请求
{
"model": "wan2.7-image",
"prompt": "A long hotel corridor with a heavily patterned carpet, doors receding into the distance. A woman in a floor-length crimson satin coat has just taken one step forward. Behind her heel the carpet pattern has started to peel up off the floor, lifting away as loose ribbons of colour that keep the print exactly and curl into the air down the length of the hall. One hard green exit sign above, warm wall sconces along the corridor. Wide low camera on the floor line, deep perspective, real cloth weight, film grain, slight vignette, no text.",
"n": 1,
"size": "1536x1024"
}

使用 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",
"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
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",
"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", "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", "input": {"messages": [{"role": "user", "content": [{"text": "生成四张角色一致的季节分镜"}]}]},
"parameters": {"size": "2K", "enable_sequential": true, "n": 4, "watermark": false}
}'

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

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

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

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

契约 ID: media.wan2-7-image.v1Adapter: image.wan.v1@v1指纹: 37190bffce54c9ca3798ec5be9345928603c19e05aa2283900c9108169f02bc7

官方来源: Alibaba Cloud Model Studio

契约参数

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

支持能力

  • allowed_values · size · 1K, 2K
  • 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",
  "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",
  "n": 1,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "size": "1K"
}