← Back to Skills Marketplace
jerryxn

img2-generate-only

by JerryXn · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
29
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install img2-generate-only
Description
独立单图 IMG2 生图 Skill。必须显式提供接口地址和密钥,调用 OpenAI 兼容图片接口生成单张图片并本地落盘。
README (SKILL.md)

IMG2 Generate Only Skill

定位

这是一个纯单图生图 Skill

它只做一件事:

prompt → 调用 IMG2 / gpt-image-2 → 本地落盘 → 返回结构化结果

不依赖任何历史本地配置,也不包含你们之前环境里的私有 provider 配置

使用时必须由用户或工作流显式提供入参

它不负责:

  • 飞书发送
  • 云盘上传
  • 批量并发
  • 文章排版
  • 公众号推送

执行脚本

python3 /home/ye/.openclaw/workspace/scripts/img2_generate_only.py

绝对必填参数

下面这些参数必须由用户显式提供:

1)prompt

最终图片提示词。

2)base_url

图片接口基础地址。

例如:

https://your-api.example.com/v1

脚本会自动请求:

{base_url}/images/generations

3)api_key

接口密钥。

例如:

sk-xxxx

4)model

图片模型名称。

当前标准推荐:

gpt-image-2

5)size

图片尺寸。

例如:

1024x1024

6)task_name

任务名,用于输出文件命名。

7)timeout_ms

单张图最长等待时间,单位毫秒。

推荐:

300000

可选参数

8)output_dir

图片输出目录。

默认:

/tmp/generated-images

9)response_format

返回格式。

默认推荐:

b64_json

10)n

生成数量。

当前这个 Skill 只支持单图,必须为:

1

11)return_base64

是否在结果中返回 base64。

默认:

false

一般不建议开启,返回 image_path 更稳。


标准输入 JSON

{
  "prompt": "一只毛茸茸的橘猫坐在窗边,真实摄影风格,阳光柔和,无文字,无水印",
  "base_url": "https://your-api.example.com/v1",
  "api_key": "sk-xxxx",
  "model": "gpt-image-2",
  "size": "1024x1024",
  "task_name": "orange-cat-window",
  "timeout_ms": 300000,
  "output_dir": "/tmp/generated-images",
  "response_format": "b64_json",
  "n": 1,
  "return_base64": false
}

命令行调用示例

JSON 方式

python3 /home/ye/.openclaw/workspace/scripts/img2_generate_only.py '{
  "prompt": "一只毛茸茸的橘猫坐在窗边,真实摄影风格,阳光柔和,无文字,无水印",
  "base_url": "https://your-api.example.com/v1",
  "api_key": "sk-xxxx",
  "model": "gpt-image-2",
  "size": "1024x1024",
  "task_name": "orange-cat-window",
  "timeout_ms": 300000,
  "output_dir": "/tmp/generated-images",
  "response_format": "b64_json",
  "n": 1,
  "return_base64": false
}'

CLI 参数方式

python3 /home/ye/.openclaw/workspace/scripts/img2_generate_only.py \
  --prompt "一只毛茸茸的橘猫坐在窗边,真实摄影风格,阳光柔和,无文字,无水印" \
  --base_url "https://your-api.example.com/v1" \
  --api_key "sk-xxxx" \
  --model gpt-image-2 \
  --size 1024x1024 \
  --task_name orange-cat-window \
  --timeout_ms 300000 \
  --output_dir /tmp/generated-images

成功输出

{
  "ok": true,
  "stage": "done",
  "image_path": "/tmp/generated-images/orange-cat-window-20260508-094000.png",
  "bytes": 1544093,
  "base_url": "https://your-api.example.com/v1",
  "model": "gpt-image-2",
  "size": "1024x1024"
}

如果 return_base64=true,还会额外返回:

{
  "b64": "..."
}

失败输出

失败时返回结构化 JSON:

{
  "ok": false,
  "stage": "request",
  "http_status": 502,
  "upstream_error_type": "upstream_error",
  "upstream_error_message": "Upstream request failed",
  "error": "脱敏后的错误信息",
  "diagnosis": {
    "category": "upstream_failure",
    "human_reason": "图片模型上游服务失败或临时不可用;不是本地脚本问题。",
    "retryable": true
  }
}

失败诊断字段

工作流建议读取:

  • ok
  • stage
  • http_status
  • upstream_error_type
  • upstream_error_message
  • diagnosis.category
  • diagnosis.human_reason
  • diagnosis.retryable

这个 Skill 的边界

这个 Skill 只负责单张图生成

如果用户需要:

  • 多张图批量生成
  • 受控并发
  • 队列监控
  • state.json / batch_result.json

那应该使用单独的批量调度器,而不是把这些逻辑塞进这个单图 Skill 里。


一句话定义

这是一个纯独立单图 IMG2 生图节点:用户必须显式提供 prompt + base_url + api_key + model + size + task_name + timeout_ms,脚本返回本地图片路径和结构化状态。

Usage Guidance
Use this only if you can inspect and trust /home/ye/.openclaw/workspace/scripts/img2_generate_only.py or replace it with a reviewed bundled script. Verify the API base URL, use a dedicated API key, and avoid exposing the key in command history or shared example files.
Capability Analysis
Type: OpenClaw Skill Name: img2-generate-only Version: 0.1.0 The skill bundle defines a tool for generating images via OpenAI-compatible APIs. The documentation in SKILL.md and the example input are consistent with the stated purpose of calling an external API and saving the resulting image locally. While the execution command in SKILL.md references a hardcoded absolute path (/home/ye/.openclaw/workspace/scripts/img2_generate_only.py) for a script not included in the provided files, there is no evidence of malicious intent, prompt injection, or unauthorized data access within the analyzed content.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The described purpose is coherent: generate one image through an OpenAI-compatible image API and save it locally. It requires sensitive inputs such as base_url and api_key, which are expected for this purpose.
Instruction Scope
The skill says users or workflows must explicitly provide inputs and limits generation to n=1, which is scoped. However, users should verify the base_url before sending an API key or prompt.
Install Mechanism
There is no install spec and no included implementation, yet SKILL.md instructs execution of an absolute-path Python script outside the skill package. That unreviewed script is the component that would handle the API key and network call.
Credentials
Python execution, a provider API call, and local image output are proportionate to image generation, but the registry metadata under-declares the Python dependency and primary credential compared with SKILL.md.
Persistence & Privilege
No background worker, long-running persistence, memory storage, or privilege escalation is described. Persistence appears limited to saving the generated image file.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install img2-generate-only
  3. After installation, invoke the skill by name or use /img2-generate-only
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
- 全新 Skill,专注执行“单张图片生成”任务,需用户显式提供核心参数 - 不依赖任何历史本地配置,无内建私有 provider 支持 - 仅负责从 OpenAI 兼容图片接口生成一张图片并本地保存,返回结构化 JSON 结果 - 不包含消息推送、上传、批量、排版等功能,仅完成图片生成 - 参数、输出标准化,便于工作流集成与失败诊断
Metadata
Slug img2-generate-only
Version 0.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is img2-generate-only?

独立单图 IMG2 生图 Skill。必须显式提供接口地址和密钥,调用 OpenAI 兼容图片接口生成单张图片并本地落盘。 It is an AI Agent Skill for Claude Code / OpenClaw, with 29 downloads so far.

How do I install img2-generate-only?

Run "/install img2-generate-only" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is img2-generate-only free?

Yes, img2-generate-only is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does img2-generate-only support?

img2-generate-only is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created img2-generate-only?

It is built and maintained by JerryXn (@jerryxn); the current version is v0.1.0.

💬 Comments