返回顶部
g

glm-image-gen智谱图像生成

Official skill for generating high-quality images from text prompts using ZhiPu GLM-Image API.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.3
安全检测
已通过
495
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

glm-image-gen

GLM-Image Generation Skill / GLM-Image 图片生成技能

使用智谱GLM-Image API从文本提示词生成高质量图片。

When to Use / 使用场景

  • - Generate images from text descriptions / 从文字描述生成图片
  • Create AI art, illustrations, or concept art / 创作 AI 艺术、插画或概念图
  • User mentions 生图, 文生图, AI 绘画, generate image, text-to-image, create image
  • User provides a prompt and wants to see it visualized / 用户提供描述并想看到可视化效果

Key Features / 核心特性

  • - High-quality generation: HD mode produces more detailed, refined images (~20s)
  • Multiple aspect ratios: Square, portrait, landscape formats supported
  • GLM-Image model: Latest model with improved understanding and quality
  • Excellent at: Scientific illustrations (科普插画), high-quality portraits (高质量人像), social media graphics (社交媒体图文), commercial posters (商业海报)
  • Watermark control: Enable/disable watermarks (requires signed disclaimer for no-watermark)
  • Content safety: Built-in content filtering for compliance

Resource Links / 资源链接

ResourceLink
Get API Key智谱开放平台 API Keys
API Docs
Image Generation / 图像生成 | | Model Docs | GLM-Image 模型文档 |

Prerequisites / 前置条件

API Key Setup / API Key 配置(Required / 必需)

脚本通过 ZHIPUAPIKEY 环境变量获取密钥,可与其他智谱技能复用同一个 key。
This script reads the key from the ZHIPUAPIKEY environment variable. Reusing the same key across Zhipu skills is optional.

Get Key / 获取 Key: Visit 智谱开放平台 API Keys to create or copy your key.

Setup options / 配置方式(任选一种):

  1. 1. Global config (recommended) / 全局配置(推荐): Set once in openclaw.json under env.vars, all Zhipu skills will share it:

json
{
env: {
vars: {
ZHIPUAPIKEY: 你的密钥
}
}
}

  1. 2. Skill-level config / Skill 级别配置: Set for this skill only in openclaw.json:

json
{
skills: {
entries: {
glm-image-generation: {
env: {
ZHIPUAPIKEY: 你的密钥
}
}
}
}
}

  1. 3. Shell environment variable / Shell 环境变量: Add to ~/.zshrc:

bash
export ZHIPUAPIKEY=你的密钥

💡 如果你已为其他智谱 skill(如 glmocr、glmv-caption)配置过 key,它们共享同一个 ZHIPUAPIKEY,无需重复配置。

Security & Transparency / 安全与透明度

  • - Environment variables used / 使用的环境变量:
- ZHIPUAPIKEY (required / 必需)
  • - Fixed endpoint / 固定官方端点: https://open.bigmodel.cn/api/paas/v4/images/generations
  • No custom API URL override / 不支持自定义 API URL 覆盖: avoids accidental key exfiltration via redirected endpoints.

⛔ MANDATORY RESTRICTIONS / 强制限制 ⛔

  1. 1. ONLY use GLM-Image API — Execute the script python scripts/glmimagecli.py
  2. NEVER generate images yourself — Do NOT try to create images using built-in vision or any other method
  3. NEVER offer alternatives — Do NOT suggest I can try to describe it or similar
  4. IF API fails — Display the error message and STOP immediately
  5. NO fallback methods — Do NOT attempt image generation any other way

📋 Output Display Rules / 输出展示规则

After running the script, present the generation result clearly.

  • - Show the generated image URL(s) — images are temporary (30 days), remind user to save
  • Display the prompt used and generation parameters (size, quality)
  • If content_filter indicates issues, show the warning level

⚠️ Image Display / 图片展示注意:

The API returns a temporary image URL (valid for 30 days). You should:

  1. 1. Show the image — Use the URL to display the image in the chat (if platform supports it)
  2. Remind user to save — 图片链接有效期 30 天,请及时下载保存
  3. Offer to send to Feishu — If user wants the image sent to a Feishu chat, use the message tool with the image URL

How to Use / 使用方法

Generate from Prompt / 从提示词生成

bash
python scripts/glmimagecli.py --prompt 一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云

Specify Size / 指定尺寸

bash
python scripts/glmimagecli.py --prompt 赛博朋克风格的城市夜景 --size 1568x1056

HD Quality (default for glm-image) / 高清质量(glm-image 默认)

bash
python scripts/glmimagecli.py --prompt 中国山水画风格,远山近水,云雾缭绕 --quality hd

Disable Watermark (requires signed disclaimer) / 关闭水印(需签署免责声明)

bash
python scripts/glmimagecli.py --prompt 商业设计素材 --no-watermark

Save Image to Local File / 保存图片到本地

bash
python scripts/glmimagecli.py --prompt 中国水墨画风格 --save image.png
python scripts/glmimagecli.py --prompt 赛博朋克城市 --size 1728x960 --save ~/Pictures/cyberpunk.png

Specify User ID (for content moderation) / 指定用户 ID(用于内容审核)

bash
python scripts/glmimagecli.py --prompt ... --user-id user_12345

Specify Model / 指定模型

bash
python scripts/glmimagecli.py --prompt ... --model glm-image
python scripts/glmimagecli.py --prompt ... --model cogview-4

CLI Reference / CLI 参数

python {baseDir}/scripts/glmimagecli.py --prompt TEXT [--model MODEL] [--size SIZE] [--quality QUALITY] [--no-watermark] [--user-id ID] [--save FILE]

ParameterRequiredDescription
--prompt, -pYesText description of the desired image / 图片的文本描述
--model, -m
No | Model: glm-image (default), cogview-4, cogview-3-flash / 模型 | | --size, -s | No | Image size (default: 1280x1280) / 图片尺寸 | | --quality, -q| No | Quality: hd (default) or standard / 质量 | | --no-watermark | No | Disable watermark (requires signed disclaimer) / 关闭水印 | | --user-id | No | End-user ID for content moderation (6-128 chars) / 终端用户 ID | | --save | No | Save generated image to local file / 保存生成的图片到本地文件 |

Supported Sizes / 支持的尺寸

GLM-Image recommended sizes:

SizeAspect RatioUse Case
1280x12801:1Square (default)
1568×1056
3:2 | Landscape / 横向 |
| 1056×1568 | 2:3 | Portrait / 纵向 |
| 1472×1088 | ~4:3 | Wide landscape |
| 1088×1472 | ~3:4 | Tall portrait |
| 1728×960 | 16:9 | Ultra

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 glm-image-gen-1776107043 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 glm-image-gen-1776107043 技能

通过命令行安装

skillhub install glm-image-gen-1776107043

下载

⬇ 下载 glm-image-gen v1.0.3(免费)

文件大小: 9.02 KB | 发布时间: 2026-4-17 14:57

v1.0.3 最新 2026-4-17 14:57
- Removed requirement for the GLM_OCR_TIMEOUT environment variable; now only ZHIPU_API_KEY is needed.
- Updated metadata to simplify environment requirements.
- No other changes to functionality or usage instructions.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部