Logoglmimage.blog
HomeBlogGuidesPrompts
Z.ai API快速开始 + 参数速查表
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

  • 例如 1280x1280 (Z.AI)
  • 自定义尺寸:宽/高应在 1024–2048 之间,且是 32 的倍数(根据 API 参考)。(Z.AI)

quality

  • hd(更多细节,较慢~20秒)
  • standard(更快~5-10秒) (Z.AI)

生产环境提示

  • 在服务端验证size(范围+能否被32整除)
  • 暂时性失败时重试
  • 存储返回的URL或立即下载以备CDN/缓存使用
All Posts

Author

avatar for GLMImage.blog
GLMImage.blog

Categories

  • GLM-Image
  • Technical Architecture
端点和最小化curl请求参数速查表(最常用)modelsizequality生产环境提示

More Posts

GLM-Image for Posters: 10 Prompt Templates That Actually Render Text

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.

avatar for GLMImage.blog
GLMImage.blog
2026/01/15
The AR + Diffusion Hybrid Explained (With Diagrams)

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.

avatar for GLMImage.blog
GLMImage.blog
2026/01/15
Transformers AR Stage Deep Dive: What Are the 256→4K Tokens?

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.

avatar for GLMImage.blog
GLMImage.blog
2026/01/16
Logoglmimage.blog

The unofficial community resource for GLM-Image.

Resources

  • Guides
  • Prompts
  • Blog
  • Feedback

Legal

  • Cookie Policy
  • Privacy Policy
  • Terms of Service

© 2026. The unofficial community resource for GLM-Image.

GitHubGitHub