跳到內容
開放式卡斯塔利控制台

圖片

wan2.7-image API

透過 Modelflare 使用本頁顯示的確切型號 ID 呼叫 wan2.7-image。

使用準確的型號 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 金鑰與 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": "A white cat runs through a neon-lit street in the rain",
"size": "1024x1024", "n": 1
}'

OpenAI相容的影像模型使用prompt、n、size和quality;僅在官方頁面記錄時才使用編輯。

Wan2.7 Image / Pro 使用同步影像 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 種十六進位顏色,百分比總計為 100%

使用扁平形狀進行簡單呼叫;使用input.messages和parameters進行多圖像、區域編輯和順序生成。最多支援 9 個輸入影像,每個影像小於 20 MB,每邊 240–8,000 像素,長寬比為 1:8 到 8:1。普通輸出計數為1-4,順序輸出計數為1-12; Pro 文字轉影像支援 4K 外部順序模式,而其他組合最高可達 2K。

Wan2.7影像既支援平面形狀,也支援嵌套的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}
}'

無效的模型參數傳回帶有請求ID的4xx;使用所選模型合約定義的回應欄位和錯誤訊息。

此頁面涵蓋 Modelflare 模型產生和編輯呼叫。搜尋或地圖豐富、語音管理和元素庫管理是此公共模型呼叫表面之外的資源 API,並且不是必需的請求欄位。

此模型使用按呼叫計費。請參閱 型號定價頁面 ,以了解當前客戶價格、參考標價和完整規格。

型號 ID 差異
wan2.7-image 本頁記錄的模型。
媒體合約 · v1

合約 ID: media.wan2-7-image.v1適配器: image.wan.v1@v1指紋: 37190bffce54c9ca3798ec5be9345928603c19e05aa2283900c9108169f02bc7

官方來源: Alibaba Cloud Model Studio

合約參數

意圖字段控制項選項
sizeselect1K / 2K
nnumber—

支援的功能

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

結構化請求範例

text

意圖

{
  "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

意圖

{
  "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"
}