Ana içeriğe geç
tongyi-mai avatarı

Z-Image Base API

tongyi-mai/z-image/base

Z-Image temel modeliyle prompt’a hassas biçimde uyan, yüksek kaliteli ve stil açısından çeşitli görseller üretin.

görsel megapikseli başına 0.01

Model girdisi

Input

The prompt to generate an image from.

The size of the generated image. Use a preset string (e.g. '4_3_1k') or a custom {width, height} object.

Min: 1 - Max: 50

The number of inference steps to perform.

The same seed and the same prompt given to the same version of the model will output the same image every time.

Safety checker can only be disabled on API call

The format of the generated image.

The acceleration level to use.

Min: 1 - Max: 20

The guidance scale to use for the image generation.

The negative prompt to use for the image generation.

Min: 1 - Max: 4

The number of images to generate. Each generated image is billed.

You need to be logged in to run this model and view results.
Log in

Model çıktısı

Output

Fill in the input form and click submit to see the output
Logs (1 lines)

Örnek istekler

Örnekler

Example output 1Example output 2

Z-Image Base API

Z-Image Base is a text-to-image AI model by tongyi-mai. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at $0.01 per megapixel.

POST https://queue.modelrunner.run/tongyi-mai/z-image/base

cURL

# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/tongyi-mai/z-image/base \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "your prompt here",
    "metadata": {
      "project": "my-project"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/tongyi-mai/z-image/base/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/tongyi-mai/z-image/base/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("tongyi-mai/z-image/base", {
  input: {
    "prompt": "your prompt here"
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/tongyi-mai/z-image/base",
    headers=headers,
    json={
      "prompt": "your prompt here"
    },
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

Input parameters of Z-Image Base
NameTypeRequiredDescription
promptstringyesThe prompt to generate an image from.
image_sizeenumnoThe size of the generated image. Use a preset string (e.g. '4_3_1k') or a custom {width, height} object. One of: 1_1_512, 1_1_1k, 1_1_2k, 1_1_4k, 16_9_512, 16_9_1k, 16_9_2k, 16_9_4k, 9_16_512, 9_16_1k, 9_16_2k, 9_16_4k, 4_3_512, 4_3_1k, 4_3_2k, 4_3_4k, 3_4_512, 3_4_1k, 3_4_2k, 3_4_4k, 3_2_512, 3_2_1k, 3_2_2k, 3_2_4k, 2_3_512, 2_3_1k, 2_3_2k, 2_3_4k, 4_5_512, 4_5_1k, 4_5_2k, 4_5_4k, 5_4_512, 5_4_1k, 5_4_2k, 5_4_4k, 4_1_512, 4_1_1k, 4_1_2k, 4_1_4k, 1_4_512, 1_4_1k, 1_4_2k, 1_4_4k, 8_1_512, 8_1_1k, 8_1_2k, 8_1_4k, 1_8_512, 1_8_1k, 1_8_2k, 1_8_4k, 21_9_512, 21_9_1k, 21_9_2k, 21_9_4k. Default: "4_3_1k".
num_inference_stepsintegernoThe number of inference steps to perform. Default: 28.
seedintegernoThe same seed and the same prompt given to the same version of the model will output the same image every time.
enable_safety_checkerbooleannoIf set to true, the safety checker will be enabled. Default: true.
output_formatenumnoThe format of the generated image. One of: jpeg, png, webp. Default: "png".
accelerationenumnoThe acceleration level to use. One of: none, regular, high. Default: "regular".
guidance_scalenumbernoThe guidance scale to use for the image generation. Default: 4.
negative_promptstringnoThe negative prompt to use for the image generation. Default: "".
num_imagesintegernoThe number of images to generate. Each generated image is billed. Default: 1.

Machine-readable: OpenAPI schema · llms.txt

Use Z-Image Base from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Z-Image Base becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint tongyi-mai/z-image/base.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run tongyi-mai/z-image/base on ModelRunner to generate image”. MCP setup guide.

Model Detayları

Model Detayları

Z-Image Base, güçlü bir çeşitlilik ve geniş bir stil yelpazesiyle yüksek kaliteli görseller sunmak için tasarlanmış temel bir text-to-image üretim modelidir. Z-Image ailesinin çekirdeği olarak prompt’ları yüksek hassasiyetle yorumlayacak şekilde geliştirilmiştir; bu da onu ayrıntılı metin açıklamalarını tutarlı ve estetik açıdan hoş görsellere dönüştürmek isteyen içerik üreticileri için ideal bir araç yapar. İster konsept çizim, ister pazarlama görselleri, ister illüstratif içerik üretin, Z-Image Base yapısal tutarlılığı korurken girdinizdeki nüanslara sadık kalmayı hedefler.

Modelin temel yetenekleri arasında karmaşık sahne açıklamalarını işlemek ve geniş bir sanatsal stil yelpazesi sunmak yer alır. Görsel üretmek ve sonuçları hemen indirmek için modeli doğrudan uygulama arayüzünden kullanabilirsiniz. Model, çıktıya ince ayar yapmak için çeşitli yapılandırma seçeneklerini destekler; en-boy oranı, inference adımı sayısı ve guidance scale üzerinde kontrol sağlar.

**Girdi Ayarları** En iyi sonucu almak için şu parametreleri ayarlayabilirsiniz: * **Prompt**: Birincil metin açıklaması (ör. "Pencere kenarında örgü ören büyükanne"). * **Image Size**: Kompozisyonunuza uyması için `landscape_4_3`, `square` ya da `portrait_16_9` gibi standart en-boy oranları arasından seçin. * **Inference Steps**: Kalite ile hız arasındaki dengeyi ayarlayın. Varsayılan 28 adımdır; 1 ile 50 arasında bir değer seçilebilir. * **Guidance Scale**: Modelin prompt’a ne kadar sıkı uyacağını belirler. Varsayılan değer 4’tür. * **Negative Prompt**: Görselde yer almasını istemediğiniz öğeleri belirtin.

**Örnek Kullanım** Bu modeli ModelRunner JavaScript client ile çalıştırmak için aşağıdaki kod parçacığını kullanın. Örnek, belirli boyut ve kalite ayarlarıyla standart bir üretim isteğini gösterir.

```javascript import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("tongyi-mai/z-image/base", { input: { prompt: "Grandmother knitting by a window, an empty chair by her", image_size: "landscape_4_3", num_inference_steps: 28, num_images: 1, enable_safety_checker: true, output_format: "png", acceleration: "regular", guidance_scale: 4, negative_prompt: "blurry, low quality, distorted" } });

console.log(result); ```