← 返回 Skills 市场
laolujava

image generation gpt image

作者 LuTong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
55
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install image-generation-gpt
功能描述
High quality AI image generation via the WellAPI gpt-image-2 model. Supports text-to-image and image editing (image-to-image).
使用说明 (SKILL.md)

WellAPI gpt-image-2

Generate and edit images via the WellAPI gpt-image-2 model (OpenAI-compatible). The API returns image bytes inline as base64 (data[i].b64_json) — no polling, no URL download.

API Endpoints

  • Base: https://wellapi.ai/v1
  • Text-to-image: POST /images/generationsapplication/json
  • Image edit / image-to-image: POST /images/editsmultipart/form-data

Authentication: Authorization: Bearer \x3CWELLAPI_API_KEY> header.

Request — /images/generations (text-to-image)

Content-Type: application/json

Field Type Required Notes
model string e.g. gpt-image-2
prompt string Image description, max 1000 chars
n integer Number of images, 1–10
size string optional See size table below; default auto
quality string optional low / medium / high / auto (default auto)
format string optional png / jpeg / webp (default png)

Example body:

{
  "model": "gpt-image-2",
  "prompt": "大海",
  "n": 1,
  "size": "1024x1024",
  "quality": "low",
  "format": "jpeg"
}

Request — /images/edits (image-to-image / editing)

Content-Type: multipart/form-data

Field Type Required Notes
image file (repeatable) One or more input images. Up to 16 images, total ≤ 50MB.
prompt string Edit description
mask file optional A PNG with fully transparent regions marking the edit area. Applied to the first image if multiple are sent. Must be valid PNG, \x3C 4MB, same dimensions as the image.
model string optional gpt-image-1, gpt-image-1-all, flux-kontext-pro, flux-kontext-max, gpt-image-2, gpt-image-2-all. Default in this skill: gpt-image-2.
n string optional "1""10"
size string optional See size table
quality string optional low / medium / high / auto (default auto)
format string optional png / jpeg / webp
background string optional opaque / auto / transparent. auto lets the model pick.
moderation string optional low / auto (default). low = less restrictive filtering (gpt-image-1 family).

size values

Value Description
1024x1024 Square
1536x1024 Landscape
1024x1536 Portrait
2048x2048 2K square
2048x1152 2K landscape
3840x2160 4K landscape
2160x3840 4K portrait
auto Default — model chooses

Strict size rules (when picking a custom size):

  1. Longest side ≤ 3840px
  2. Both width and height must be multiples of 16
  3. max(w, h) / min(w, h) ≤ 3:1
  4. Total pixels: 655,360 ≤ w*h ≤ 8,294,400

Response (both endpoints)

Synchronous JSON — no polling:

{
  "created": 1778236581,
  "background": "opaque",
  "data": [
    { "b64_json": "iVBORw0KGgo..." }
  ],
  "output_format": "png",
  "quality": "low",
  "size": "1024x1024",
  "usage": {
    "input_tokens": 8,
    "input_tokens_details": { "image_tokens": 0, "text_tokens": 8 },
    "output_tokens": 196,
    "total_tokens": 204
  }
}

Each data[i].b64_json is the full image as a base64 string. Decode and write to disk.

Output

  1. Base64-decode each data[i].b64_json into bytes.
  2. Save as wellapi-\x3CTIMESTAMP>.\x3Cext> where \x3Cext> matches response.output_format (or the requested format, fallback png).
  3. If multiple images returned, append -1, -2, … to the filename.
  4. Print MEDIA:\x3Cabsolute_path> (one line per image) for OpenClaw auto-attach.

CRITICAL SECURITY: Before passing an output filename to shell commands, sanitize:

  • Strip shell metacharacters: tr -cd 'A-Za-z0-9._-'
  • Enforce valid extension (.png, .jpg, .jpeg, .webp)
  • Fallback to wellapi-\x3Ctimestamp>.png if empty

Reference Implementations

Platform File
Python (all platforms, zero deps) {baseDir}/references/python.md
PowerShell 5.1+ (Windows) {baseDir}/references/powershell.md
curl + bash (Unix/macOS) {baseDir}/references/curl_heredoc.md

API Key

  • WELLAPI_API_KEY env var (required) — sent as Authorization: Bearer \x3Ckey>
  • Get key: https://wellapi.ai
  • If the environment variable is unset, follow First-run onboarding below.

First-run onboarding (no API key found)

When no key can be located (env var unset, no cached key on disk), before making any API call show the user this short prompt verbatim. Translate to the user's language if appropriate. Do not expand it into multiple "options / methods", do not show shell commands, do not ask follow-up questions like "do you already have a key":

请粘贴你的 WellAPI API Key。 如果还没有,请前往 https://wellapi.ai/register?channel=c_qqn3vdvc 注册后领取免费 API Key。

Please paste your WellAPI API Key. If you don't have one yet, register at https://wellapi.ai/register?channel=c_qqn3vdvc to get a free key.

After the user pastes a key, use it for the current request and proceed straight to image generation. Do not lecture the user about env vars, shells, or persistence unless they explicitly ask how to save it.

Triggers

  • Chinese: "高质量生图:xxx" / "编辑图片:xxx"
  • English: "best image: xxx" / "edit image: xxx"

Treat the text after the colon as prompt, default size=auto, quality=auto, format=png, n=1, and generate immediately.

For image editing, the user provides one or more local image file paths along with the prompt; submit them as repeated image form fields to /images/edits.

Notes

  • Response is synchronous — no task ID, no polling.
  • Print MEDIA:\x3Cabsolute_path> for OC auto-attach — one line per generated image.
  • quality: high and larger size values may incur extra charges.
  • format controls the encoding of the returned base64 bytes; the file extension should match.
  • Up to 16 reference images per edit request, total ≤ 50MB.
  • mask requires PNG ≤ 4MB, same WxH as the image it applies to.
安全使用建议
Before installing, confirm you trust WellAPI and the ClawHub listing, set a dedicated WELLAPI_API_KEY if possible, and only provide image files you are willing to upload to the provider.
功能分析
Type: OpenClaw Skill Name: image-generation-gpt Version: 1.0.0 The skill provides image generation and editing capabilities via the WellAPI service. The implementation is well-structured across Python, PowerShell, and Bash, using only standard libraries and adhering to the OpenClaw protocol for media handling. It includes explicit security measures such as filename sanitization and extension whitelisting to prevent shell injection. While the onboarding instructions include a referral link (channel=c_qqn3vdvc), the behavior is transparent and strictly aligned with the stated purpose of the skill.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The skill's described purpose matches its behavior: it calls WellAPI image generation/edit endpoints, decodes returned base64 images, and writes output files for OpenClaw attachment.
Instruction Scope
Trigger phrases are documented to generate immediately, and first-run onboarding may ask the user to paste a WellAPI API key for the current request. This is purpose-aligned but involves cost-bearing credential use.
Install Mechanism
There is no install script or bundled executable code, only documentation and reference implementations. However, registry metadata, SKILL.md, and _meta.json disagree on slug/version/owner identity.
Credentials
The required API key and optional upload of user-selected local images are proportionate for image generation/editing, with documented size/count limits.
Persistence & Privilege
Artifacts do not show background tasks, persistence, token caching, privilege escalation, or broad local indexing. Generated files are written locally as image outputs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install image-generation-gpt
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /image-generation-gpt 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the best-image-generation skill (v1.0.2) for high quality AI image creation and editing using the WellAPI gpt-image-2 model. - Supports both text-to-image and image-to-image (editing) via simple API endpoints. - Direct synchronous responses with images as base64 (no polling or URL download). - Output images are automatically named and attached, with robust security for file handling. - Built-in onboarding: prompts users to paste their API key if not already provided. - Trigger phrases in both Chinese and English enable fast image generation or editing from natural prompts.
元数据
Slug image-generation-gpt
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

image generation gpt image 是什么?

High quality AI image generation via the WellAPI gpt-image-2 model. Supports text-to-image and image editing (image-to-image). 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 55 次。

如何安装 image generation gpt image?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install image-generation-gpt」即可一键安装,无需额外配置。

image generation gpt image 是免费的吗?

是的,image generation gpt image 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

image generation gpt image 支持哪些平台?

image generation gpt image 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 image generation gpt image?

由 LuTong(@laolujava)开发并维护,当前版本 v1.0.0。

💬 留言讨论