Source: https://ailoot.ai/models/zh-hant-tw/wan2-7-image/
Canonical: https://ailoot.ai/models/zh-hant-tw/wan2-7-image/
Language: zh-hant-tw

# wan2.7-image

[Markdown](https://ailoot.ai/models/zh-hant-tw/wan2-7-image/index.md) · [JSON](https://ailoot.ai/models/zh-hant-tw/wan2-7-image/facts.json)

## [wan2.7-image](https://ailoot.ai/models/zh-hant-tw/wan2-7-image/)

用於準備不同設計方案與插畫的文字轉圖片模型。Alibaba 表示，此版本的設計方向是以更快速度建立圖片。

- [**Ailoot · 圖片** `POST /v1/images/generations` `wan2.7-image`](https://ailoot.ai/models/zh-hant-tw/wan2-7-image/#method-0)

關於模型

此說明介紹模型的能力。Ailoot 可用的輸入、輸出與選項，依所選方法列於下方。

Wan2.7-Image 依據文字任務描述建立圖片。目前 Ailoot 卡片明確提供文字輸入及圖片結果。Alibaba 表示，此版本著重更快取得不同生成版本。模型開發商規格也提供編輯、參考圖組合及局部變更；這些功能須另行支援圖片輸入，目前卡片的方法未提供。

#### Alibaba 描述的模式

參考圖模式可在任務中使用最多九張原始圖片，作為物件外觀、構圖及細節的依據。模型可將多份素材組合成新場景，或在維持主要物件的情況下修改原圖。局部編輯可明確指定區域：同一張圖片最多可指定兩個矩形區域。

Alibaba 規格中的一般模式會產生一至四個結果。連續系列可請求最多 12 張圖片，以故事或角色的共同特徵彼此連結。這是系列的上限：模型自行決定所需影格數量，也可能回傳更少。任務描述與原始素材有助於維持共同故事線。

不使用參考圖或連續系列的一般文字轉圖片生成，可使用推理模式。模型會在建立圖片前，更詳細地分析複雜描述。圖片編輯及連續系列不使用此模式。3–10 色的指定調色盤可用於連續系列以外的模式。

#### 輸入與結果

模型開發商使用原圖的模式支援 JPEG、JPG、不含透明度的 PNG、BMP 及 WEBP。每一邊可為 240 至 8000 像素，檔案大小最多 20 MB，長寬比為 1:8 至 8:1。

文字任務描述支援中文與英語，上限為 5000 個字元；超出的部分會被捨棄。此版本未提供負面描述或額外擴充任務描述。

輸出格式為 PNG，解析度最多為 2K 等級。此標示指整體像素面積，而非固定的最長邊上限；畫面形狀可在 1:8 至 8:1 範圍內選擇。以預設解析度進行編輯時，結果保留最後一張參考圖的長寬比。同一個起始隨機種子有助於取得相似版本，但不保證完全相同。

**Ailoot · 圖片** `POST /v1/images/generations` `wan2.7-image`

[`wan2.7-image`](https://ailoot.ai/models/zh-hant-tw/#m=wan2.7-image&route=Core&caller=wan2.7-image&fmt=images)

Alibaba /`wan2.7-image`

### 入門

用於準備不同設計方案與插畫的文字轉圖片模型。Alibaba 表示，此版本的設計方向是以更快速度建立圖片。

接受的輸入

文字

結果

圖片

### Ailoot 可用 · 輸入與方法

**Ailoot · 圖片** `POST /v1/images/generations`

輸入

`text`

輸出

`image`

輸出格式

圖片檔案

| 欄位 | 類型 | 要求 | 值與限制 | 預設值 |
| --- | --- | --- | --- | --- |
| 欄位`model` | 類型`string` | 要求必填 | 值與限制 wan2.7-image | 預設值— |
| 欄位`prompt` | 類型`string` | 要求必填 | 值與限制 長度下限: 1 | 預設值— |
| 欄位`n` | 類型`integer` | 要求選填 | 值與限制 最小值: 1 | 預設值1 |
| 欄位`response_format` | 類型`string` | 要求選填 | 值與限制 url, b64\_json | 預設值— |
| 欄位`stream` | 類型`boolean` | 要求選填 | 值與限制 | 預設值false |
| 欄位`size` | 類型`string` | 要求選填 | 值與限制 依模型而定 | 預設值— |
| 欄位`partial_images` | 類型`integer` | 要求選填 | 值與限制 依模型而定 | 預設值— |
| 欄位`images[].image_url` | 類型`string` | 要求不支援 | 值與限制 解碼後位元組數上限: 20,971,520 MIME 類型: image/png, image/jpeg 每個陣列的圖片數上限: 9 條件: 每個 images\[\] 物件提供一個實際 URL。陣列項目數與此字串葉節點是不同概念。 適用條件: 僅限 JSON images/edits；JSON images/generations 不會解析 images 參考資料。 | 預設值— |
| 欄位`image` | 類型`file` | 要求選填 | 值與限制 解碼後位元組數上限: 20,971,520 MIME 類型: image/png, image/jpeg 適用條件: 以 multipart/form-data 生成 | 預設值— |
| 欄位`image[]` | 類型`file[]` | 要求選填 | 值與限制 項目數上限: 9 解碼後位元組數上限: 20,971,520 MIME 類型: image/png, image/jpeg 適用條件: 以 multipart/form-data 生成 | 預設值— |

輸入素材組合

**文字生成圖片** · 必填： prompt

**reference\_images\_generation** · 必填： prompt

方法參數與生命週期

| 參數 | 規格 |
| --- | --- |
| 參數`material_types` | 規格text |
| 參數`required` | 規格model, prompt |
| 參數`optional_controls` | 規格null |
| 參數`content_type` | 規格application/json |

生命週期： `synchronous_result_then_owned_library`

`GET /v1/media/tasks/{task_id}` · 實際回傳的 task\_id 或媒體庫紀錄

`GET /v1/media/assets/{asset_id}/content`

`GET /v1/media/assets`

`GET /v1/media/assets/{asset_id}`

方法結構與 ID 均為精確值；供應商能力與准入狀態分開。

### 方案

#### Ailoot 方法費率

輸出

US$0.03 *每張 1K 圖片*

輸出

US$0.03 *每張 2K 圖片*

Ailoot 會在請求前預留估算金額。取得結果後，依實測用量結算最終費用。串流結算採用最終用量紀錄。[預留金額與結算的運作方式 →](https://ailoot.ai/docs/zh-hant-tw/billing/reserve/)

#### 參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

wan2.7-image

#### 各設定的價格

| 設定 | 計費條件 | 費用 |
| --- | --- | --- |
| 設定wan2.7-image · 預設設定 | 計費條件預設設定 | 費用 輸入 · 輸入 **US$0.00** 每次呼叫 輸出 · 輸出 **US$0.06** 每次呼叫 |

### 請求範例

#### Ailoot · 圖片

curlPython SDKNode.js SDK

```bash
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "wan2.7-image", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
```

```python
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin

def save_images(items):
    if not items: raise SystemExit("No completed images; retain the full response")
    for index, item in enumerate(items):
        encoded=item.get("b64_json")
        uri=item.get("url", "")
        if not encoded and uri.startswith("data:image/"):
            header, separator, encoded=uri.partition(",")
            if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
        if encoded:
            raw=base64.b64decode(encoded,validate=True)
        elif uri:
            uri=urljoin("https://api.ailoot.ai",uri)
            parsed=urlsplit(uri)
            if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
                raise SystemExit("Invalid returned image URL")
            owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
            args=["curl","--fail-with-body","--silent","--show-error",uri]
            if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
            temporary=Path(f"image-{index}.bin")
            subprocess.run(args+["-o",str(temporary)],check=True)
            raw=temporary.read_bytes()
            temporary.unlink()
        else: raise SystemExit("Image has neither bytes nor URL")
        if not raw: raise SystemExit("Empty image result")
        ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
        Path(f"image-{index}.{ext}").write_bytes(raw)
    print("Every returned image saved; complete response metadata retained")

f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'wan2.7-image', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
```

```js
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "wan2.7-image", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
  const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
  if(!encoded && uri.startsWith("data:image/")) {
    const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
    encoded=uri.slice(comma+1);
  }
  if(encoded) {
    if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
    raw=Buffer.from(encoded,"base64");
  } else if(uri) {
    const u=new URL(uri,"https://api.ailoot.ai");
    if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
    const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
    const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
    if(!response.ok) throw new Error("Image content download failed: "+response.status);
    raw=Buffer.from(await response.arrayBuffer());
  } else throw new Error("Image has neither bytes nor URL");
  if(!raw.length) throw new Error("Empty image result");
  const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
  writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
```

### 接收並儲存結果

#### Ailoot · 圖片

下載每張傳回的圖片，或儲存其 Base64 內容

- `GET /v1/media/tasks/{task_id}`
- `GET /v1/media/assets/{asset_id}/content`
- `GET /v1/media/assets`
- `GET /v1/media/assets/{asset_id}`

##### 保留所有已完成的結果

請儲存每張已完成的圖片；從每個傳回的 URL 取得圖片，或解碼其 Base64 內容。

儲存所有資料項目。解碼每個 b64\_json，或透過每個回傳的已簽署 URL 取得內容。依實際 MIME 類型／位元組內容選擇副檔名。

##### 需要檢查原始回應時

若圖片生成或編輯結果需要檢查，請保留原始 operation\_id/X-Client-Request-ID 與回傳的結果資訊。使用實際的 task\_id 或 asset\_id 值，透過媒體庫取回自己擁有的既有結果。請勿重新提交生成／編輯請求，也請勿以 operation\_id 組成輪詢 URL。

回應欄位

| 欄位 | 類型 |
| --- | --- |
| 欄位`created` | 類型integer |
| 欄位`data[].url` | 類型string |
| 欄位`data[].b64_json` | 類型base64 string |
| 欄位`usage` | 類型object |

錯誤與後續步驟

| 回應 | 條件 | 下一步 |
| --- | --- | --- |
| 回應400 · `invalid_request_error` | 條件必要欄位、素材表示方式或參數值無效 | 下一步提出新的建立請求前，先修正指定欄位。 |
| 回應`server_error` | 條件回傳的回應表示該作業或結果需要檢查 | 下一步保留原始回傳的作業／任務 ID、請求標頭與回應；繼續以支援的方式讀取該原始作業。請勿重新提交建立請求。 |

### 別名

#### 模型別名

**Ailoot** [`wan2.7-image`](https://ailoot.ai/models/zh-hant-tw/#m=wan2.7-image&route=Core&caller=wan2.7-image&fmt=images)

#### 方法路徑別名

請使用上方列出的 API 方法路徑。

#### 相關呼叫用 ID

[`wan2.7-image`](https://ailoot.ai/models/zh-hant-tw/#m=wan2.7-image&route=Core&caller=wan2.7-image&fmt=images)

FAQ · wan2.7-image

可以使用哪些輸入與結果？

`POST /v1/images/generations` · `wan2.7-image`: `text` → `image`

請求使用哪些欄位？

`POST /v1/images/generations` · `wan2.7-image`: `model`, `prompt`, `n`, `response_format`, `stream`, `image`, `image[]`

適用哪些限制？

`POST /v1/images/generations` · `wan2.7-image`: `n.minimum`: `1`

將 Ailoot 串接 Claude Code、OpenCode、Hermes 或自己的應用程式。

## 公司及其專案組合

公司及其專案組合：數百萬客戶，每月銷售額達數十億。

## 優惠購買 token。

訂閱優惠適合持續工作，折扣碼購買 token 最高可折 50%。

訂閱

為定期請求選擇優惠方案。

最高 50% 折扣碼

購買時輸入代碼，價格依活動重算。

歷史中的費用

每次請求保存模型、token 與金額。

[選擇訂閱](https://ailoot.ai/docs/zh-hant-tw/billing/subscriptions/) · [查看模型價格](https://ailoot.ai/models/zh-hant-tw/)

## 將 API 加入 你銷售的產品。

依 Ailoot 正式服務條款與授權合約串接 SaaS、應用程式與機器人；轉售請申請經銷授權。

商用應用程式

在付費功能加入文字、圖片、影片與聲音生成。

經銷授權

提供專案說明與存取方式，要求書面使用和轉售條件。

網站文件

串接前可閱讀正式服務條款、授權合約與資料處理政策。

[申請經銷授權](mailto:support@ailoot.ai) · [正式服務條款與授權合約](https://ailoot.ai/legal/offer?lang=zh-hant-tw)

## Ailoot · 公司及其專案組合





Ailoot以累積的營運經驗、廣大的客戶群、穩定的服務及持續的KPI管理為基礎。





公司及其專案組合：數百萬客戶，每月銷售額達數十億。





Ailoot將這些營運經驗用於API存取，讓客戶的產品、代理、應用程式及自動化流程使用AI功能。
