Professional AI image generation API powered by Z-Image. Start creating stunning images with our managed API service.
A managed API service powered by Z-Image from Tongyi-MAI
Optimized infrastructure for quick image generation
Official Python client library with full documentation
Support for English and Chinese text rendering
No infrastructure setup required, fully hosted solution
Built on Apache 2.0 licensed Z-Image project
API reference and integration guides
Common applications for image generation API
Design automation tools, marketing asset creation, and content generation platforms
Product visualization, catalog enrichment, and personalized marketing materials
Game assets, character designs, and visual content for interactive experiences
Custom illustrations, diagrams, and visual learning materials for educational content
Compare with other image generation solutions
| Feature | Z Image API | Other Solutions |
|---|---|---|
| Response Time | < 1 second | 5-30 seconds |
| License | ✓ Apache 2.0 | ✗ Proprietary |
| Python SDK | ✓ Native Support | Limited or REST only |
| Multilingual Text | ✓ English & Chinese | ✗ Limited |
| Self-Hosting | ✓ Full Control | ✗ Cloud Only |
| Hardware | 16GB+ Consumer GPU | Enterprise GPU Required |
| Commercial Use | ✓ Unlimited | Restrictions Apply |
Ready to experience the difference?
View PricingExperience Z Image API in action
Interactive Demo
Try it on Hugging Face
Generate high-quality images in under 1 second
Support for English and Chinese characters
Adjust size, steps, and guidance settings
Instant preview and download generated images
Note: Demo hosted on Hugging Face Spaces for public testing
Enterprise-ready API service with global availability and premium support
Fully managed API service so you don't have to worry about infrastructure, scaling, or maintenance. Focus on your application while we handle the complexity.
Sub-100ms latency worldwide
Enterprise-grade reliability
Handle any traffic volume
Direct access to our team
Easy-to-use RESTful API with Python, JavaScript, and cURL support
# Python Example
import requests
api_key = "your_api_key_here"
url = "https://api.z-image.ai/v1/generate"
response = requests.post(url,
headers={"Authorization": f"Bearer {api_key}"},
json={
"prompt": "A beautiful sunset over mountains",
"width": 1024,
"height": 1024,
"steps": 4
}
)
image_url = response.json()["image_url"]
print(f"Generated: {image_url}")
Ready to get started?
Choose a plan that fits your needs and start generating images today.
View PricingChoose the plan that fits your project
Perfect for getting started
Ideal for creators and professionals
For studios and power users
Get Started Today: Choose from our flexible pricing plans and start generating professional images with Z-Image API.
Step-by-step guide to get started with Z Image API
Begin by cloning the repository from GitHub and installing the required dependencies.
# Clone the repository from GitHub
git clone https://github.com/Tongyi-MAI/Z-Image.git
cd Z-Image
# Install dependencies
pip install -r requirements.txt
Ensure your system meets the minimum requirements:
Download the pre-trained model weights from the official repository.
# Download model weights
python download_models.py --model turbo
Start generating images with simple Python code. See the Python guide below for detailed examples.
# Basic image generation example
from zimage import ZImageAPI
api = ZImageAPI()
image = api.generate("A beautiful sunset over mountains")
image.save("output.png")
Ready to dive deeper?
Explore Full Documentation on GitHubPython integration examples and best practices
Simple Python script to generate your first image:
import torch
from zimage import ZImagePipeline
# Initialize the pipeline
pipeline = ZImagePipeline.from_pretrained(
"Tongyi-MAI/Z-Image-Turbo",
torch_dtype=torch.float16
)
pipeline = pipeline.to("cuda")
# Generate image
prompt = "A futuristic city at night"
image = pipeline(
prompt=prompt,
num_inference_steps=4,
guidance_scale=0.0
).images[0]
# Save the result
image.save("generated_image.png")
Customize generation parameters for optimal results:
from zimage import ZImagePipeline
pipeline = ZImagePipeline.from_pretrained(
"Tongyi-MAI/Z-Image-Turbo"
)
# Advanced parameters
image = pipeline(
prompt="Your detailed prompt here",
negative_prompt="unwanted elements",
height=1024,
width=1024,
num_inference_steps=4,
guidance_scale=0.0,
seed=42 # For reproducibility
).images[0]
image.save("advanced_output.png")
Efficiently generate multiple images with Python loops:
from zimage import ZImagePipeline
pipeline = ZImagePipeline.from_pretrained(
"Tongyi-MAI/Z-Image-Turbo"
)
prompts = [
"A serene lake at dawn",
"A bustling marketplace",
"An ancient temple"
]
for idx, prompt in enumerate(prompts):
image = pipeline(prompt=prompt).images[0]
image.save(f"batch_image_{idx}.png")
print(f"Generated image {idx + 1}/{len(prompts)}")
Robust Python code with proper exception handling:
from zimage import ZImagePipeline
import torch
try:
pipeline = ZImagePipeline.from_pretrained(
"Tongyi-MAI/Z-Image-Turbo"
)
image = pipeline(
prompt="Your prompt",
num_inference_steps=4
).images[0]
image.save("output.png")
print("Image generated successfully!")
except torch.cuda.OutOfMemoryError:
print("GPU out of memory. Try reducing image size.")
except Exception as e:
print(f"Error occurred: {str(e)}")
Join the Z Image API community
Z Image API is an open-source, high-performance image generation service developed by Tongyi MAI. It generates high-quality images with sub-second response times, featuring full Python integration and comprehensive documentation.
Integration is straightforward using our Python SDK. Simply install the package from GitHub, import the ZImagePipeline class, and start generating images with just a few lines of code. Check our Python guide section for detailed examples.
Z Image API requires Python 3.8+, a CUDA-compatible GPU with at least 16GB VRAM, and PyTorch 2.0 or later. The API is optimized to run efficiently on consumer-grade hardware.
Yes! Z Image API is completely open-source and released under the Apache 2.0 license, which means you can use it freely for both personal and commercial projects.
The official Z Image API repository is available at github.com/Tongyi-MAI/Z-Image. You'll find complete source code, documentation, examples, and community support.
Absolutely! We welcome contributions from the community. Visit our GitHub repository to report issues, submit pull requests, or participate in discussions about new features and improvements.
Start using Z-Image API now or subscribe for product updates and tips
Get notified as soon as we go live
Receive pricing details before public launch
Early access to API documentation and guides
Regular updates on development progress
1,247+ developers already on the waitlist
Thank you for subscribing. You'll receive updates about new features and tips.
Check your email for confirmation.
View PricingChoose a plan that fits your needs and start generating professional images with Z-Image API today