omnimind-ai/omnibotskills/gpt-image-gen

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

通过 GPT Image API (gpt-image-2) 生成图片。当用户提到"生成图片"、"画一张图"、"GPT 图片"、"image generation"、或需要 AI 绘图时触发此 skill。使用环境变量 $IMAGE_GEN_API_KEY 作为 API Key,调用 OpenAI 兼容的图片生成接口。

Install

npx vskill@latest install omnimind-ai/omnibotskills/gpt-image-gen

SKILL.md

GPT Image Generation Skill

通过 GPT Image API 生成高质量图片。

Quick Workflow

  1. 检查环境变量 $IMAGE_GEN_API_KEY 和 $IMAGE_GEN_API_URL 是否已设置
  2. 构造 prompt 并确定尺寸
  3. 直接运行 bundled 脚本 scripts/gen.py
  4. 将输出图片保存到 workspace 并展示

Environment Setup

必需环境变量
bash
export IMAGE_GEN_API_KEY="sk-xxx" # API Key
export IMAGE_GEN_API_URL="https://your-api.example.com/v1/images/generations" # API 端点
Check API Key
bash
echo $IMAGE_GEN_API_KEY | head -c 10

如果为空,提示用户设置环境变量。

Bundled Scripts

运行脚本(无额外依赖,仅用 Python 标准库):

bash
python3 <skill-path>/gpt-image-gen/scripts/gen.py "prompt" [output_path] [size] [quality] [count]

参数说明:

  • prompt — 图片描述(必填)
  • output_path — 输出文件路径,默认 /workspace/generated_image.png
  • size — 图片尺寸,可选 1024x1024 / 1536x1024 / 1024x1536 / 2048x2048,默认 1024x1024
  • quality — 质量,可选 low / medium / high,默认 high
  • count — 生成数量 1-10,默认 1

示例:

bash
python3 <skill-path>/gpt-image-gen/scripts/gen.py "一位年轻漂亮的中国小红书女博主,时尚穿搭,精致妆容" /workspace/out.png 1024x1536 high 1

Step-by-Step

当用户请求生成图片时:

  1. 理解需求 — 确定 prompt、尺寸偏好、风格
  2. 检查环境变量 — echo $IMAGE_GEN_API_KEY | head -c 10
  3. 运行脚本 — 传入参数调用 gen.py
  4. 展示结果 — 用 ![caption](omnibot://workspace/generated_image.png) 展示
  5. 复制下载 — 按需额外 copy 到 /storage/emulated/0/Download/

API Reference

  • Endpoint: 由环境变量 $IMAGE_GEN_API_URL 指定,需兼容 OpenAI Images API 格式
  • Auth: Authorization: Bearer $IMAGE_GEN_API_KEY
  • Model: gpt-image-2
  • Response: JSON with data[0].b64_json (base64 encoded PNG)
  • Sizes: 1024x1024, 1536x1024 (横屏), 1024x1536 (竖屏), 2048x2048
  • Qualities: low, medium, high

网关兼容性说明

部分 API 网关(如 New API)会拒绝 Python urllib 的默认 User-Agent,返回 403。脚本已内置 curl/8.14.1 的 UA 头来规避此问题。如仍有兼容性问题,可修改 scripts/gen.py 中的 User-Agent 头。

Troubleshooting

IssueCause & Fix
IMAGE_GEN_API_KEY 未设置提示用户先 export IMAGE_GEN_API_KEY=sk-xxx
IMAGE_GEN_API_URL 未设置提示用户设置 API 端点
HTTP 401/403Key 无效或过期,或 User-Agent 被网关拒绝
HTTP 429频率限制,稍等重试
HTTP 502/524上游服务不可用或超时,稍等重试
超时图片生成较慢,timeout 设 300 秒
返回非图片内容API 返回异常 JSON,检查 error 字段

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/omnimind-ai/omnibotskills/gpt-image-gen/badge)](https://verified-skill.com/skills/omnimind-ai/omnibotskills/gpt-image-gen)

Something wrong with this skill or its page? Tell us.