
2026/01/15
Z.ai API快速开始 + 参数速查表
使用官方Z.ai API通过GLM-Image生成图像——包含curl和Python示例、尺寸规则、质量模式和最佳实践。
端点和最小化curl请求
Z.ai的图像生成端点是:
POST https://api.z.ai/api/paas/v4/images/generations (Z.AI)
curl --request POST \
--url https://api.z.ai/api/paas/v4/images/generations \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"model": "glm-image",
"prompt": "一张干净的海报,标题为春季促销,CTA为立即购买",
"size": "1280x1280",
"quality": "hd"
}'
响应返回一个可下载的图像URL。(Z.AI)
参数速查表(最常用)
model
"glm-image"(Z.AI)
size
quality
hd(更多细节,较慢~20秒)standard(更快~5-10秒) (Z.AI)
生产环境提示
- 在服务端验证
size(范围+能否被32整除) - 暂时性失败时重试
- 存储返回的URL或立即下载以备CDN/缓存使用
Author

Categories
More Posts

GLM-Image for Posters: 10 Prompt Templates That Actually Render Text
A practical prompt library for poster design with legible typography using GLM-Image—layout recipes, font controls, and 10 copy-paste templates.


The AR + Diffusion Hybrid Explained (With Diagrams)
GLM-Image uses autoregressive planning for layout + diffusion decoding for pixel fidelity. Here's the intuition, diagrams, and what it means for text rendering.


Transformers AR Stage Deep Dive: What Are the 256→4K Tokens?
GLM-Image generates image tokens autoregressively—starting from ~256 tokens and expanding to 1K–4K. Here's what that means for layouts, typography, and control.

