원클릭으로
cogview-image-gen
智谱 CogView-4 文生图技能。支持中英双语提示词,支持汉字生成,可自定义分辨率。通过智谱开放平台 API 调用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
智谱 CogView-4 文生图技能。支持中英双语提示词,支持汉字生成,可自定义分辨率。通过智谱开放平台 API 调用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Create data analytics and data pipeline diagrams using PlantUML syntax with analytics/database stencil icons. Best for ETL pipelines, data lakes, real-time streaming, data warehousing, and BI dashboards. NOT for simple flowcharts (use mermaid) or general cloud infra (use cloud skill).
Use when the user wants to create any technical diagram - architecture, data flow, flowchart, sequence, agent/memory, or concept map - and export as SVG+PNG. Trigger on: "画图" "帮我画" "生成图" "做个图" "架构图" "流程图" "可视化一下" "出图" "generate diagram" "draw diagram" "visualize" or any system/flow description the user wants illustrated.
Create IoT architecture diagrams using PlantUML syntax with device/sensor stencil icons. Best for smart home, industrial IoT (IIoT), fleet management, edge computing, and sensor network diagrams. NOT for general cloud infra (use cloud skill) or simple flowcharts (use mermaid).
Create flowcharts, sequence diagrams, state machines, class diagrams, Gantt charts, and mindmaps using simple text-based syntax. Best for process flows, API interactions, and technical documentation. NOT for data-driven charts (use vega), quick KPI visuals (use infographic), or layered system architecture (use architecture).
Create security architecture diagrams using PlantUML syntax with identity, encryption, firewall, and compliance stencil icons. Best for IAM flows, zero-trust architectures, encryption pipelines, compliance auditing, and threat detection. NOT for general cloud infra (use cloud skill) or simple flowcharts (use mermaid).
Create data-driven charts with Vega-Lite (simple) and Vega (advanced). Best for bar, line, scatter, heatmap, area charts, and multi-series analytics. Use when you have numeric data arrays needing statistical visualization. Vega for radar charts and word clouds. NOT for process diagrams (use mermaid) or quick KPI cards (use infographic).
| name | cogview-image-gen |
| description | 智谱 CogView-4 文生图技能。支持中英双语提示词,支持汉字生成,可自定义分辨率。通过智谱开放平台 API 调用。 |
基于智谱 AI CogView-4 模型的文生图能力。支持中英双语输入,原生中文语义理解,能在图片中生成汉字。
API Key 从 OpenClaw 配置文件中自动读取(与 GLM 模型共用同一个 Key):
# 配置文件路径
~/.openclaw/openclaw.json
# Key 路径
models.providers.qtcool.apiKey
无需额外配置环境变量。
使用 exec 工具执行 shell 命令调用脚本:
# 基础用法
bash skills/cogview-image-gen/scripts/generate.sh "一只可爱的橘猫" output.png
# 指定分辨率
bash skills/cogview-image-gen/scripts/generate.sh "山水画风格" output.png --size 768x1344
# 指定保存目录
bash skills/cogview-image-gen/scripts/generate.sh "城市夜景" /tmp/my-image.png
# 读取 API Key 并调用
API_KEY=$(python3 -c "import json; print(json.load(open('$HOME/.openclaw/openclaw.json'))['models']['providers']['qtcool']['apiKey'])")
curl -s --max-time 120 \
"https://open.bigmodel.cn/api/paas/v4/images/generations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "cogview-4",
"prompt": "你的提示词",
"size": "1024x1024"
}'
| 尺寸 | 比例 | 适用场景 |
|---|---|---|
| 1024×1024 | 1:1 | 通用、头像、社交媒体 |
| 768×1344 | 9:16 | 手机壁纸、海报 |
| 864×1152 | 3:4 | 竖版海报 |
| 1344×768 | 16:9 | 横版海报、封面 |
| 1152×864 | 4:3 | PPT 封面、文档配图 |
| 1440×720 | 2:1 | 横幅、Banner |
| 错误 | 原因 | 解决 |
|---|---|---|
| 余额不足 | 账户没额度 | 去 open.bigmodel.cn 充值 |
| 模型不存在 | API 地址错误 | 检查 endpoint |
| 请求超时 | 网络问题 | 检查服务器网络 |
| 图片下载失败 | URL 过期 | 重新生成(URL 有效期 1 小时) |
生成图片后,使用 message 工具发送:
message(action=send, media="/path/to/image.png", message="描述文字")
图片默认保存到 workspace/media/generated/ 目录。定期清理旧文件:
# 清理 7 天前的生成图片
find workspace/media/generated/ -name "*.png" -mtime +7 -delete