Skip to main content
tongyi-mai avatar

Z-Image Turbo API

tongyi-mai/z-image/turbo

High-speed 6B parameter text-to-image generation optimized for cost efficiency and volume. Produces up to 4MP images in an 8-step pipeline suitable for rapid prototyping.

0.005 per megapixel of image

Model Input

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: 8

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: 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 Output

Output

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

Model Example Requests

Examples

Example output 1Example output 2Example output 3Example output 4Example output 5Example output 6

Z-Image Turbo API

Z-Image Turbo 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.005 per megapixel.

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

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/turbo \
  -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/turbo/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/tongyi-mai/z-image/turbo/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

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

const result = await modelrunner.subscribe("tongyi-mai/z-image/turbo", {
  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/turbo",
    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

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. Default: "4_3_1k".
num_inference_stepsintegernoThe number of inference steps to perform. Default: 8.
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. Default: "png".
accelerationenumnoThe acceleration level to use. Default: "regular".
num_imagesintegernoThe number of images to generate. Each generated image is billed. Default: 1.

Machine-readable: OpenAPI schema · llms.txt

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

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Z-Image Turbo 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/turbo.

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/turbo on ModelRunner to generate image”. MCP setup guide.

Model Details

Model Details

Tongyi-MAI's Z-Image Turbo is a streamlined text-to-image generation model engineered for speed and economic scalability. Built on a 6-billion parameter architecture, it prioritizes throughput without sacrificing essential visual coherence. By compressing the diffusion process into a maximum of 8 inference steps, this model significantly reduces generation time compared to standard architectures that typically require 20 to 50 steps.

### Capabilities and Features

This model is specifically tuned for high-volume production environments. Users can generate images with resolutions up to 4 megapixels, supporting various aspect ratios from square to wide landscape. The 8-step pipeline is fully configurable; users can lower the step count to as few as 1 for ultra-fast thumbnail generation or utilize the full 8 steps for final production assets.

**Key benefits include:**

* **Rapid Iteration:** Support for batch sizes up to 4 images per request allows for quick side-by-side comparison of prompts and seeds. * **Flexible Output:** Customize image dimensions via standard presets (e.g., `4_3_1k`) or specific pixel counts, with support for JPEG, PNG, and WebP formats. * **Cost-Effective Scaling:** The lightweight architecture makes it ideal for applications requiring thousands of assets, such as dynamic content generation or A/B testing visuals.

### When to use this model

Choose Z-Image Turbo when speed and volume are the primary constraints. It excels at rapid prototyping, storyboarding, and generating content variations where cost-per-pixel is a critical metric. While it offers robust prompt adherence, users requiring pixel-perfect photorealism or complex spatial reasoning might prefer larger, slower models.

To run via ModelRunner javascript client, use the following code:

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

const result = await modelrunner.subscribe('tongyi-mai/z-image/turbo', { input: { prompt: "Cinematic shot of a futuristic cyberpunk street, neon lights, rain on pavement, highly detailed", image_size: "16_9_1k", num_inference_steps: 8, num_images: 1, enable_safety_checker: true, output_format: "png" } }); ```