# Wan v2.2 A14B Image-to-Video A14B with LoRAs API

> 接受 Wan 2.2 LoRA 權重的 A14B 圖像轉影片，並可反向播放片段

根據 `prompt` 將 `image_url` 製成動畫，並透過 `loras` 提供自訂 LoRA 權重。選用的 `end_image_url` 可固定最後影格，`reverse_video` 會反向播放結果。`num_frames` 範圍為 17 至 161，`resolution` 為 480p 至 720p，長寬比可為 auto、16:9、9:16 或 1:1。

- Model id: `wan/v2.2-a14b/image-to-video/lora`
- Made by: Alibaba
- Category: Image to Video
- Output: video
- Estimated price per run: from $1.006 / run (cheapest run $1.006 (1006 API credits))
- Run: `POST https://api.doitong.ru/v1/run/wan/v2.2-a14b/image-to-video/lora`
- Quote: `POST https://api.doitong.ru/v1/quote/wan/v2.2-a14b/image-to-video/lora`
- Docs page: https://doitong.com/zh-TW/developers/models/wan/v2.2-a14b/image-to-video/lora

## Pricing

Price: **from $1.006 / run** (the lowest tier; the quote prices your exact input). Estimated from the typical cost of one run. The quote is exactly what the run charges.

Price rules (the first rule that matches the input wins; a parameter you leave out counts as its default):

- When `num_frames` > 81 and `resolution` = 480p: base price × 2
- When `num_frames` > 81 and `resolution` = 580p: base price × 2
- When `num_frames` > 81 and `resolution` = 720p: base price × 2

The full example input below costs $1.006 = 1006 API credits (1 request × 1006 API credits).

Prices are the upstream price in USD, paid from the API balance in API credits (1000 API credits = 1 USD). `POST https://api.doitong.ru/v1/quote/wan/v2.2-a14b/image-to-video/lora` with the same JSON body returns the exact price for that input; the quote is exactly what a run charges. Invalid input is never charged and failed or canceled requests are refunded automatically.

## Input parameters

Send either the canonical name or the native field name (not both). Canonical names are the same across models.

| Parameter | Canonical name | Type | Required | Default | Allowed values / range | Description |
|---|---|---|---|---|---|---|
| `image_url` | `image` | string (image URL) | yes |  |  | 來源圖像 URL；選取的長寬比會決定是否需要預處理：不一致時會先調整大小，再進行中心裁切。 |
| `prompt` |  | string | yes |  |  | 引導影片生成的文字指示。 |
| `num_frames` |  | integer | no | `81` | 17 – 161 | 生成的影格數量，範圍為 17–161，包含邊界值。 |
| `frames_per_second` |  | integer \| null | no | `16` | 4 – 60 | 生成影片的影格速率，接受 4 到 60 的值；將 `adjust_fps_for_interpolation` 設為 false 可原樣保留此速率。使用插值且 `adjust_fps_for_interpolation` 為 true（其預設值）時，將此速率乘以插值影格數加一，即可取得最終 FPS。例如，16 FPS 搭配 1 個插值影格會變成 32 FPS。 |
| `negative_prompt` |  | string | no | `` |  | 生成影片時套用的負面提示詞。 |
| `seed` |  | integer \| null | no |  |  | 使生成結果可重現的種子。設為 None 會隨機選擇種子。 |
| `resolution` |  | enum (string) | no | `720p` | `480p`, `580p`, `720p` | 輸出影片解析度：480p、580p 或 720p。 |
| `aspect_ratio` |  | enum (string) | no | `auto` | `auto`, `16:9`, `9:16`, `1:1` | 生成影片的比例；設為 'auto' 時會根據輸入圖像自動選擇。 |
| `num_inference_steps` |  | integer | no | `27` | 2 – 40 | 取樣步數；步數越多，處理時間越長但品質越好。 |
| `enable_safety_checker` |  | boolean | no | `false` |  | 處理前的輸入安全篩選，只有獲授權的帳戶可以關閉。未獲授權的請求一律會篩選；其他情況下，true 會啟用篩選。 |
| `enable_output_safety_checker` |  | boolean | no | `false` |  | 控制生成影片的安全篩選；設為 true 會在生成後執行檢查。 |
| `enable_prompt_expansion` |  | boolean | no | `false` |  | 允許大型語言模型以詳細資訊豐富提示詞。啟用此擴展不會改變提示詞的含義。 |
| `acceleration` |  | enum (string) | no | `regular` | `none`, `regular` | 加速設定，建議選擇 'regular'。提高加速程度會犧牲品質，以縮短生成時間。 |
| `guidance_scale` |  | number | no | `3.5` | 1 – 10 | 無分類器引導強度；比例越高，越貼近提示詞，但可能造成品質損失。 |
| `guidance_scale_2` |  | number | no | `4` | 1 – 10 | 控制模型在第二階段遵循提示詞程度的引導強度。 |
| `shift` |  | number | no | `5` | 1 – 10 | 影片位移設定，允許範圍為 1.0–10.0。 |
| `interpolator_model` |  | enum (string) | no | `film` | `none`, `film`, `rife` | 影格插值設定：選擇 None 略過插值，或指定執行插值的模型。 |
| `num_interpolated_frames` |  | integer | no | `1` | 0 – 4 | 在每兩個生成影格之間的間隔插入 0–4 個插值影格。 |
| `adjust_fps_for_interpolation` |  | boolean | no | `true` |  | 影格速率調整開關：false 會保留提供的 FPS，true 則將其乘以插值影格數加一。因此，啟用調整且插入 1 個影格時，16 FPS 會變成 32 FPS。 |
| `video_quality` |  | enum (string) | no | `high` | `low`, `medium`, `high`, `maximum` | 輸出影片品質設定；設定值越高，會以較大的檔案換取更佳的視覺效果。 |
| `video_write_mode` |  | enum (string) | no | `balanced` | `fast`, `balanced`, `small` | 影片寫入模式，balanced 在速度與品質之間取得平衡。選擇 small 可產生最小檔案並以最慢速度寫入；較快的寫入會更早回傳結果，但會建立較大的檔案。 |
| `loras` |  | array of object {path, weight_name, scale, transformer} | no | `[]` |  | 推論期間套用的 LoRA 權重。 |
| `loras[].path` |  | string | yes |  |  | LoRA 權重的位置，以 URL 或路徑指定。 |
| `loras[].weight_name` |  | string \| null | no |  |  | LoRA 權重名稱；僅當 Hugging Face 儲存庫包含超過 1 個 safetensors 檔案時為必填。此名稱僅在 `path` 指定這類儲存庫時使用。 |
| `loras[].scale` |  | number | no | `1` | 0 – 4 | 合併至基礎模型前套用至 LoRA 權重的倍數。 |
| `loras[].transformer` |  | enum (string) | no | `high` | `high`, `low`, `both` | LoRA 權重的 Transformer 目標。選擇 'high' 將權重套用至高雜訊 Transformer，選擇 'low' 套用至低雜訊 Transformer，或選擇 'both' 載入至兩個 Transformer。 |
| `reverse_video` |  | boolean | no | `false` |  | 影片反轉開關；true 會反轉播放方向。 |
| `end_image_url` | `end_image` | string (image URL) \| null | no |  |  | 指向結束圖像的 URL。 |

File parameters (`image`, `end_image`) take a public `https://` URL, a `data:` URI up to 10 MB, or the `file_url` of an upload from `POST /files`.

## Example input

Required parameters only:

```json
{
  "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
  "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
```

A fuller example:

```json
{
  "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
  "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
```

## Run it

Set `DOITONG_API_KEY` to a key from https://doitong.com/developers/dashboard#keys. `?wait=20` returns the finished request in the same call when it is ready within 20 seconds; otherwise poll `GET /requests/{id}` (it also accepts `?wait=`), or pass `webhook_url`.

### curl

```bash
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/wan/v2.2-a14b/image-to-video/lora?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"
```

### JavaScript

```javascript
const API = "https://api.doitong.ru/v1";
const headers = {
  "Authorization": "Bearer " + process.env.DOITONG_API_KEY,
  "Content-Type": "application/json",
};

// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/wan/v2.2-a14b/image-to-video/lora?wait=20", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);

// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
  res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
  request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
```

### Python

```python
import os
import requests

API = "https://api.doitong.ru/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}

payload = {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
}

# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/wan/v2.2-a14b/image-to-video/lora", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
    raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])

# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
    request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
    raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
```

### MCP

The MCP server at `https://api.doitong.ru/v1/mcp` exposes the tools `search_models`, `get_model`, `quote`, `run`, `get_request`, `cancel_request`, `list_requests`, `create_upload` and `get_account`. A `run` call for this model:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "run",
    "arguments": {
      "model_id": "wan/v2.2-a14b/image-to-video/lora",
      "input": {
        "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
        "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
      },
      "wait_seconds": 20
    }
  }
}
```

## Response

Every call returns a request object. `status` is one of `queued`, `running`, `succeeded`, `failed`, `canceled`. `outputs` lists the generated files with URLs on our storage (kept forever, or 7 days with `?storage=temporary`; `storage` says which); `output` is the model's own result object with the same URLs.

```json
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "wan/v2.2-a14b/image-to-video/lora",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 1006,
    "usd": "1.006",
    "charged": 1006,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "video": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_name": "0-output.mp4",
      "file_size": 1843200
    },
    "prompt": "The white dragon warrior stands still, eyes full of determination and strength. The camera slowly moves closer or circles around the warrior, highlighting the powerful presence and heroic spirit of the character.",
    "seed": 42
  },
  "outputs": [
    {
      "type": "video",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_size": 1843200,
      "width": 1280,
      "height": 720,
      "duration": 5,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
```

### Output fields (`output`)

| Field | Type | Description |
|---|---|---|
| `video` | object {url, content_type, file_name, file_size} | 生成產生的影片檔案。 |
| `prompt` | string | 用於生成影片的文字提示詞。 |
| `seed` | integer | 生成期間套用的種子值。 |

## Related models

- [Wan v2.2 A14B Text-to-Image A14B with LoRAs](https://doitong.com/developers/models/wan/v2.2-a14b/text-to-image/lora.md) (`wan/v2.2-a14b/text-to-image/lora`): $0.05 / image
- [Wan-2.2 Text-to-Video A14B with LoRAs](https://doitong.com/developers/models/wan/v2.2-a14b/text-to-video/lora.md) (`wan/v2.2-a14b/text-to-video/lora`): from $0.507 / run
- [Wan 3.0 Image to Video](https://doitong.com/developers/models/alibaba/wan-3.0/image-to-video.md) (`alibaba/wan-3.0/image-to-video`): from $0.05 / second
- [FLUX 3 Max Image to Video](https://doitong.com/developers/models/blackforestlabs/flux-3-max/image-to-video.md) (`blackforestlabs/flux-3-max/image-to-video`): from $0.0425 / second of output video
- [Grok Imagine Video 1.5 Image to Video](https://doitong.com/developers/models/xai/grok-imagine-video/v1.5/image-to-video.md) (`xai/grok-imagine-video/v1.5/image-to-video`): from $0.082 / second
- [Kling 3.0 Pro Image to Video](https://doitong.com/developers/models/kling-video/v3/pro/image-to-video.md) (`kling-video/v3/pro/image-to-video`): from $0.112 / second
- [LTX 2.5 Pro Image to Video](https://doitong.com/developers/models/lightricks/ltx-2.5/image-to-video/pro.md) (`lightricks/ltx-2.5/image-to-video/pro`): from $0.12 / second
- [MiniMax H3 Image to Video](https://doitong.com/developers/models/minimax/h3/image-to-video.md) (`minimax/h3/image-to-video`): from $0.05 / second

## Links

- HTML page: https://doitong.com/developers/models/wan/v2.2-a14b/image-to-video/lora
- All models and guides for AI agents: https://doitong.com/developers/llms.txt
- OpenAPI 3.1 with this model's typed request body: https://doitong.com/developers/openapi.json?model=wan/v2.2-a14b/image-to-video/lora
- Errors: https://doitong.com/developers/docs/errors
- Model details as JSON: https://api.doitong.ru/v1/models/wan/v2.2-a14b/image-to-video/lora
