Zhipu GLM-Image Generation: Invoking GLM-Image Text-to-Image in Agents

# Preface

Generating images directly in a conversation usually means writing a separate script to call an open platform and then pasting the link back into the chat. Every time you change the size or toggle the watermark, you have to modify parameters or consult documentation, which easily becomes disconnected from the Agent’s workflow. Below we introduce a community Skill on SkillHub: “Zhipu glm-image Image Generation.” After installing and configuring a Zhipu API Key, the Agent can call GLM-Image through a unified tool interface, supporting multiple aspect ratios and a watermark switch.

# What Is This

“Zhipu glm-image Image Generation” is an Agent Skill that follows the universal SKILL.md format, identified as @user_c5e5dc86/zhipu-image, current version 1.0.0, sourced from the community, categorized under design-media. The Skill package states it targets the OpenClaw ecosystem (skill.json requires OpenClaw >= 4.10.0, Python >= 3.8) and leverages the GLM-Image model on Zhipu’s open platform for text-to-image generation. The SkillHub publisher is user_c5e5dc86, and the author is credited as skill大神.

Official entry points:

  • SkillHub page: https://www.skillhub.cn/skills/user_c5e5dc86/zhipu-image
  • API coordinate page: https://api.skillhub.cn/user_c5e5dc86/zhipu-image

# Core Features

According to the Skill description and skill.json, the verified capabilities include:

  1. Calls the model glm-image, default quality hd (implemented as the hd quality supported by GLM-Image).
  2. Tool name zhipu_generate_image, required parameter prompt (text description); optional size, watermark.
  3. Seven preset sizes: 1280x1280, 1568×1056, 1056×1568, 1472×1088, 1088×1472, 1728×960, 960×1728; default 1280x1280.
  4. Watermark enabled by default (watermark default true); to disable, you must sign a disclaimer on the Zhipu platform first (per the Skill documentation).
  5. On success, returns an image link; the docs note the temporary link is valid for about 30 days and should be downloaded and stored separately.
  6. Tag requires_api_key=true: you must provide a Zhipu API Key in the skill configuration or environment variables.

HTTP endpoint: https://open.bigmodel.cn/api/paas/v4/images/generations (see generate_image.py in the skill package).

# Installation and Activation

First perform a CLI check; if not installed, follow SkillHub’s official installation docs for either a full install or CLI-only:

command -v skillhub && skillhub --version
# Full installation (CLI + default Skills, recommended)
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

# CLI-only installation
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only

When installing this Skill, use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ and may not be recognized. The SkillHub page’s installation hint is: follow https://skillhub.cn/install/skillhub.md to install @user_c5e5dc86/zhipu-image. An equivalent CLI example:

skillhub install zhipu-image --namespace user_c5e5dc86 --dir ~/.cursor/skills/

Common paths: Cursor uses ~/.cursor/skills/; Claude Code uses ~/.claude/skills/; Codex uses ~/.codex/skills/ or .agents/skills/ under the project (paths from SkillHub installation docs; choose according to your client).

Configure the API Key in either of these ways (as per the skill package docs):

  1. Fill in the field api_key in the skill configuration (required: true in skill.json).
  2. Environment variable ZHIPU_IMAGE_API_KEY (used by generate_image.py and USAGE_EXAMPLE.md).

Key acquisition: https://bigmodel.cn/usercenter/proj-mgmt/apikeys ; you must register at https://bigmodel.cn/ and ensure your account has sufficient quota.

If the skill depends on Python packages, install them via requirements.txt in the skill directory (the package includes requests, etc.).

# Typical Usage

In an OpenClaw-enabled conversation with tools

Slash command form from the Skill documentation:

/zhipu_generate_image A cute kitten sitting on a sunny windowsill, with blue sky and white clouds in the background

Custom size (note the docs use × or x for width/height):

/zhipu_generate_image Cyberpunk-style city night scene with neon lights and a rainy street size=1728×960

Disable watermark:

/zhipu_generate_image Watercolor landscape, mountains and rivers, sunrise watermark=false

The README also provides wrapped command examples (whether the command is on PATH after installation depends on the host environment):

zhipu_generate_image "A cute kitten sitting on a sunny windowsill"
zhipu_generate_image "Cyberpunk-style city night scene" size=1728×960
zhipu_generate_image "Watercolor landscape" watermark=false

Run the skill script directly

In the skill directory, use generate_image.py for local verification (requires ZHIPU_IMAGE_API_KEY):

python generate_image.py "A cute orange tabby lying on a rug in the sun, fluffy, healing style"

JSON parameters:

python generate_image.py '{"prompt": "Futuristic AI robot with silver-white metallic texture, blue eyes, background is a data center", "size": "1568×1056", "watermark": true}'

On success, returns JSON containing fields such as success, image_url, prompt, size (see USAGE_EXAMPLE.md for the structure).

# Scenarios and Notes

Suitable for developers who need to quickly integrate Zhipu’s text-to-image capability into OpenClaw or Agent environments that support SKILL tools, and prefer unified control via prompt / size / watermark. SkillHub stats (at time of capture): rating 100000, downloads 1244, installs 3.

Notes:

  1. Content must comply with Zhipu Open Platform’s content safety policies; non-compliant prompts will fail.
  2. Sizes must meet documentation requirements: width and height must be integer multiples of 32, total pixels must not exceed 2^22.
  3. Fees follow Zhipu Open Platform billing standards; unrelated to this Skill.
  4. This Skill is community-published; it is not directly maintained by Zhipu. Troubleshooting: check API Key, quota, and prompt first, then use the returned error information.

# Closing

“Zhipu glm-image Image Generation” wraps GLM-Image into an Agent-callable zhipu_generate_image. After configuring the Key, you can generate images of multiple sizes and control the watermark in conversations or scripts. For installation or instructions, use the official SkillHub page: https://www.skillhub.cn/skills/user_c5e5dc86/zhipu-image

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye