August 13, 2026 · 17 min read
Text-to-image generation has matured rapidly in China. Models from Alibaba, ByteDance, Zhipu, and DeepSeek now produce images competitive with Midjourney and DALL-E at a fraction of the cost. This guide compares the leading Chinese image generation APIs with benchmarks, pricing, and production-ready code.
| Model | Provider | Resolution | Speed | Best For |
|---|---|---|---|---|
| Tongyi Wanxiang | Alibaba | up to 2048x2048 | 3-5s | Photorealistic, product images |
| Doubao Image | ByteDance | up to 1920x1080 | 2-4s | Social media, avatars |
| CogView-3 | Zhipu | up to 1536x1536 | 4-6s | Artistic, illustration |
| Hunyuan Image | Tencent | up to 1024x1024 | 3-5s | General purpose |
| DALL-E 3 | OpenAI | 1024x1024 | 5-10s | Reference baseline |
| Model | 1024x1024 | Per 100 images |
|---|---|---|
| DALL-E 3 | $0.040 | $4.00 |
| Tongyi Wanxiang | $0.008 | $0.80 |
| Doubao Image | $0.006 | $0.60 |
| CogView-3 | $0.010 | $1.00 |
| Hunyuan Image | $0.009 | $0.90 |
import requests
import base64
TOKEN = "your_tokenease_api_key"
BASE_URL = "https://tokenease.io/v1"
def generate_image(prompt, model="wanxiang", size="1024x1024", n=1):
"""Generate images through TokenEase unified API"""
response = requests.post(
f"{BASE_URL}/images/generations",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"model": model,
"prompt": prompt,
"n": n,
"size": size,
"response_format": "b64_json"
}
)
data = response.json()
images = []
for item in data["data"]:
img_data = base64.b64decode(item["b64_json"])
images.append(img_data)
return images
# Generate a product photo
images = generate_image(
prompt="Professional product photo of a minimalist wireless earbuds case on a marble surface, soft natural lighting, commercial photography style",
model="wanxiang",
size="1024x1024"
)
# Save to file
with open("product_photo.png", "wb") as f:
f.write(images[0])
print("Image generated and saved!")
Best for commercial and product imagery:
# Wanxiang supports style presets
response = requests.post(
f"{BASE_URL}/images/generations",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"model": "wanxiang",
"prompt": "E-commerce product photo, white background, studio lighting",
"size": "1024x1024",
"style": "photography", # photography, illustration, 3d, anime
"n": 4 # Generate 4 variants
}
)
Optimized for social content and character consistency:
# Doubao supports face reference for consistent characters
response = requests.post(
f"{BASE_URL}/images/generations",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"model": "doubao-image",
"prompt": "A young professional in business attire presenting in a modern office",
"size": "1024x1024",
"face_reference": base64.b64encode(open("ref_face.jpg", "rb").read()).decode(),
"style": "realistic"
}
)
Strongest for artistic and creative applications:
# CogView excels at complex compositions
response = requests.post(
f"{BASE_URL}/images/generations",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"model": "cogview-3",
"prompt": "A cyberpunk cityscape at night with neon signs reflecting in rain puddles, flying vehicles, detailed architecture",
"size": "1536x1536",
"quality": "hd"
}
)
def edit_image(image_path, mask_path, prompt):
"""Edit specific regions of an image"""
with open(image_path, "rb") as img, open(mask_path, "rb") as mask:
response = requests.post(
f"{BASE_URL}/images/edits",
headers={"Authorization": f"Bearer {TOKEN}"},
files={
"image": img,
"mask": mask
},
data={
"prompt": prompt,
"model": "wanxiang",
"size": "1024x1024"
}
)
return response.json()
# Example: Change background color
edit_image(
"product.png",
"background_mask.png", # White = edit, Black = keep
"Replace background with gradient from light blue to white"
)
import concurrent.futures
def batch_generate_product_images(products, model="wanxiang"):
"""Generate images for multiple products in parallel"""
def generate_for_product(product):
prompt = f"Professional e-commerce product photo of {product['name']}, {product['style']}, white background, studio lighting, high detail"
response = requests.post(
f"{BASE_URL}/images/generations",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"model": model,
"prompt": prompt,
"size": "1024x1024",
"n": 1
}
)
return {
"product_id": product["id"],
"image_data": response.json()["data"][0]["b64_json"]
}
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
results = list(executor.map(generate_for_product, products))
return results
# Generate for 20 products
products = [
{"id": 1, "name": "wireless headphones", "style": "minimalist black"},
{"id": 2, "name": "smart watch", "style": "sleek silver"},
# ... more products
]
images = batch_generate_product_images(products)
print(f"Generated {len(images)} product images")
# Bad prompt
bad = "a picture of a cat"
# Good prompt
good = "A fluffy orange tabby cat sitting on a velvet armchair, golden hour sunlight streaming through a window, shallow depth of field, professional pet photography, 85mm lens"
# Structure: [Subject] + [Action/Setting] + [Lighting] + [Style] + [Technical details]
# Exclude unwanted elements
response = requests.post(
f"{BASE_URL}/images/generations",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"model": "cogview-3",
"prompt": "A clean modern kitchen interior",
"negative_prompt": "cluttered, dirty, people, text, watermark, blurry, low quality",
"size": "1024x1024"
}
)
| Model | 1024x1024 Time | 1024x1024 Cost | Quality Score |
|---|---|---|---|
| Doubao Image | 2.1s | $0.006 | 8.2/10 |
| Tongyi Wanxiang | 3.4s | $0.008 | 8.5/10 |
| CogView-3 | 4.2s | $0.010 | 8.7/10 |
| Hunyuan Image | 3.1s | $0.009 | 8.0/10 |
| DALL-E 3 | 7.5s | $0.040 | 8.8/10 |
Quality scores based on human evaluation (n=100) across photorealism, prompt adherence, and aesthetic appeal.
import boto3
def generate_and_upload(prompt, s3_bucket, cdn_domain):
"""Generate image and upload to S3 + CloudFront"""
# Generate
images = generate_image(prompt, model="wanxiang")
# Upload to S3
s3 = boto3.client("s3")
key = f"images/{hash(prompt)}.png"
s3.put_object(
Bucket=s3_bucket,
Key=key,
Body=images[0],
ContentType="image/png",
ACL="public-read"
)
# Return CDN URL
return f"https://{cdn_domain}/{key}"
# Usage
image_url = generate_and_upload(
"Product photo of new smartphone",
s3_bucket="my-ecommerce-images",
cdn_domain="images.mystore.com"
)
print(f"Image live at: {image_url}")
| Industry | Use Case | Recommended Model |
|---|---|---|
| E-commerce | Product photos, lifestyle images | Tongyi Wanxiang |
| Marketing | Social media creatives, ads | Doubao Image |
| Gaming | Character art, environments | CogView-3 |
| Publishing | Book covers, illustrations | CogView-3 |
| Real Estate | Virtual staging, renders | Tongyi Wanxiang |
| Fashion | Lookbooks, model variants | Doubao Image |
Start generating images with TokenEase:
For multimodal applications, combine with our RAG guide for image-to-text and text-to-image workflows.
Last updated: August 2026. Image generation capabilities evolve rapidly.