# Z-Image Turbo Seamless Tiling Lora API

> 可產生可平鋪紋理的文字轉影像模型，支援水平、垂直或雙向平鋪及最多 3 組 LoRA

根據文字提示詞生成邊緣可順暢重複的影像，適合紋理與圖樣。`tiling_mode` 選擇 both、horizontal 或 vertical 重複方式，`tile_size` 與 `tile_stride` 用於調整平鋪。`loras` 最多接受 3 組 LoRA 權重，可從 `image_url` 開始，並可選擇使用 `mask_image_url` 進行修補；每次請求回傳 1 到 4 張 png、jpeg 或 webp 影像。

- Model id: `z-image/turbo/tiling/lora`
- Made by: Alibaba
- Category: Text to Image
- Output: image
- Price per megapixel of your output image: $0.025 / megapixel of output image (cheapest run $0.025 (25 API credits))
- Run: `POST https://api.doitong.ru/v1/run/z-image/turbo/tiling/lora`
- Quote: `POST https://api.doitong.ru/v1/quote/z-image/turbo/tiling/lora`
- Docs page: https://doitong.com/zh-TW/developers/models/z-image/turbo/tiling/lora

## Pricing

Price: **$0.025 / megapixel of output image**. Price per megapixel of your output image: the input files are measured before the run (length, resolution, frame rate). The quote measures the same files and is exactly what the run charges.

The full example input below costs $0.025 = 25 API credits (1 MP output image × $0.025).

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/z-image/turbo/tiling/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 |
|---|---|---|---|---|---|---|
| `prompt` |  | string | yes |  |  | 引導圖像生成的提示詞。 |
| `image_size` |  | object {width, height} \| enum (string) | no | `square_hd` | `square_hd`, `square`, `portrait_4_3`, `portrait_16_9`, `landscape_4_3`, `landscape_16_9`, `auto` | 生成圖像的尺寸；'auto' 會選擇 1024x1024，除非提供輸入圖像，此時會使用輸入圖像的尺寸。 |
| `num_inference_steps` |  | integer | no | `8` | 1 – 8 | 要執行的推論步數。 |
| `seed` |  | integer \| null | no |  |  | 可重現圖像的種子：模型版本不變時，相同的提示詞與種子會產生相同圖像。 |
| `num_images` | `num_outputs` | integer | no | `1` | 1 – 4 | 請求生成的圖像數量。 |
| `enable_safety_checker` |  | boolean | no | `true` |  | 安全檢查，會以黑色圖像取代任何被標記為不安全的圖像。true 會啟用檢查；false 僅對獲得授權的帳戶停用檢查，未獲授權的請求無論如何都會接受檢查。 |
| `output_format` |  | enum (string) | no | `png` | `jpeg`, `png`, `webp` | 生成圖像的檔案格式。 |
| `acceleration` |  | enum (string) | no | `regular` | `none`, `regular`, `high` | 套用至處理的加速等級。 |
| `enable_prompt_expansion` |  | boolean | no | `false` |  | 控制是否啟用提示詞擴展。 |
| `image_url` | `image` | string (image URL) \| null | no |  |  | 用於圖像轉圖像生成或圖像修補的圖像 URL。提供 mask_image_url 會選擇圖像修補；省略該參數則會選擇圖像轉圖像生成。 |
| `mask_image_url` |  | string (image URL) \| null | no |  |  | 與必要的 image_url 一同提供的圖像修補遮罩 URL。遮罩會保留黑色區域不變，並重新生成白色區域。 |
| `strength` |  | number | no | `0.6` | ≤ 1, > 0 | 僅套用於透過 image_url 提供之圖像的轉換強度；否則不使用。 |
| `tile_size` |  | integer | no | `128` | 32 – 256 | 潛在空間的圖塊大小，其中 64 對應 512px、128 對應 1024px，256 對應 2048px。生成圖像的尺寸會自動限制圖塊軸向上的大小；分塊化需要偶數值，且可被 2 整除。 |
| `tile_stride` |  | integer | no | `64` | 16 – 128 | 潛在空間的圖塊步幅，像素對應值為 32 = 256px、64 = 512px、128 = 1024px。只有 2 的倍數有效；任何超過有效圖塊大小一半的值都會自動降低至該上限。 |
| `tiling_mode` |  | enum (string) | no | `both` | `both`, `horizontal`, `vertical` | 分塊方向：'both' 涵蓋所有方向，'horizontal' 僅從左至右，'vertical' 僅從上至下。 |
| `loras` |  | array of object {path, scale} | no | `[]` |  | 要套用的 LoRA 權重，最多 3 筆。 |
| `loras[].path` |  | string | yes |  |  | LoRA 權重位置，以 URL 或 owner/repo 格式的 HuggingFace 儲存庫 ID 提供。 |
| `loras[].scale` |  | number | no | `1` | 0 – 4 | 套用於 LoRA 的縮放係數，範圍為 0.0 至 4.0。 |

File parameters (`image`, `mask_image_url`) 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"
}
```

A fuller example:

```json
{
  "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
```

## 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/z-image/turbo/tiling/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"
  }'

# 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/z-image/turbo/tiling/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"
  }),
});
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",
}

# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/z-image/turbo/tiling/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": "z-image/turbo/tiling/lora",
      "input": {
        "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
      },
      "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": "z-image/turbo/tiling/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": 25,
    "usd": "0.025",
    "charged": 25,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ],
    "timings": {},
    "seed": 42,
    "has_nsfw_concepts": [
      false
    ],
    "prompt": "string"
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "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 |
|---|---|---|
| `images` | array of object {url, content_type, file_name, file_size, width, height} | 生成圖像的檔案資訊。 |
| `timings` | object | 生成程序的計時資訊。 |
| `seed` | integer | 圖像生成種子；若輸入未提供種子，則包含隨機選取的值，否則會重複提供的值。 |
| `has_nsfw_concepts` | array of boolean | 指出生成的圖像中是否出現 NSFW 概念。 |
| `prompt` | string | 圖像生成期間使用的提示詞。 |

## Related models

- [Z Image Base](https://doitong.com/developers/models/z-image/base.md) (`z-image/base`): $0.01 / megapixel
- [Z Image Base Lora](https://doitong.com/developers/models/z-image/base/lora.md) (`z-image/base/lora`): $0.012 / megapixel
- [Z Image Turbo](https://doitong.com/developers/models/z-image/turbo.md) (`z-image/turbo`): $0.005 / megapixel
- [Z Image Turbo Lora](https://doitong.com/developers/models/z-image/turbo/lora.md) (`z-image/turbo/lora`): $0.0085 / megapixel
- [Z-Image Turbo Seamless Tiling](https://doitong.com/developers/models/z-image/turbo/tiling.md) (`z-image/turbo/tiling`): $0.02 / megapixel of output image
- [Z Image Turbo Controlnet](https://doitong.com/developers/models/z-image/turbo/controlnet.md) (`z-image/turbo/controlnet`): $0.013 / image
- [Z Image Turbo Controlnet Lora](https://doitong.com/developers/models/z-image/turbo/controlnet/lora.md) (`z-image/turbo/controlnet/lora`): $0.04 / image
- [Z Image Turbo Image To Image](https://doitong.com/developers/models/z-image/turbo/image-to-image.md) (`z-image/turbo/image-to-image`): $0.015 / image

## Links

- HTML page: https://doitong.com/developers/models/z-image/turbo/tiling/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=z-image/turbo/tiling/lora
- Errors: https://doitong.com/developers/docs/errors
- Model details as JSON: https://api.doitong.ru/v1/models/z-image/turbo/tiling/lora
