← 返回 Skills 市场
jerryxn

Happy IMG2 Direct

作者 JerryXn · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
88
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install happy-img2-direct
功能描述
Generate images with an OpenAI-compatible image provider such as happy/gpt-image-2, with retries and bounded batch concurrency.
使用说明 (SKILL.md)

Happy IMG2 Direct Skill

Generate real images through an OpenAI-compatible /images/generations endpoint configured in OpenClaw.

Default behavior:

  • provider: happy unless OPENCLAW_IMAGE_PROVIDER is set
  • model: gpt-image-2 unless OPENCLAW_IMAGE_MODEL is set
  • size: 1024x1024
  • timeout: 600000ms per image
  • output: ~/.openclaw/generated-images/
  • no local fake-image fallback
  • no built-in message delivery; send or attach files using your normal OpenClaw/channel tools

Single image

python3 skills/happy-img2-direct/scripts/run.py \
  --prompt "A realistic photo of an orange cat sitting by a window, no text, no watermark" \
  --task-name "cat-test" \
  --no-send

Useful flags:

  • --prompt required
  • --task-name output filename prefix
  • --provider provider key in OpenClaw config, default happy
  • --model image model, default gpt-image-2
  • --size default 1024x1024
  • --timeout-ms default 600000
  • --output-dir default ~/.openclaw/generated-images
  • --max-attempts default 3, maximum 5
  • --retry-base-delay, --retry-max-delay, --retry-jitter
  • --raw marker for callers that intentionally keep the user prompt unchanged
  • --no-send accepted for compatibility; this public skill always leaves delivery to the caller

Successful output is JSON containing ok:true, image_path or output, bytes, model/provider, attempt count, and run directory.

Batch images

python3 skills/happy-img2-direct/scripts/batch_run.py @batch.json

Example:

{
  "batch_name": "article-covers",
  "max_workers": 4,
  "timeout_ms": 600000,
  "send_to_feishu": false,
  "tasks": [
    {"task_name": "cover-1", "prompt": "Realistic shop counter photo, no readable text"},
    {"task_name": "cover-2", "prompt": "Realistic office desk photo, no readable text"}
  ]
}

Batch rules:

  • bounded concurrency, current hard maximum 4
  • each item has its own task directory and logs
  • one failed image does not prevent other images from finishing
  • final batch_result.json records success/failure per task
  • delivery is disabled in the public version; use OpenClaw/channel tools to send files

Retry behavior

Retries are limited and only used for retryable failures:

  • timeout
  • upstream failures
  • rate limits
  • HTTP 408/429/500/502/503/504
  • wrapper parse errors

Non-retryable errors, such as invalid requests or auth failures, fail fast with redacted diagnostics.

Safety and publishing notes

This skill intentionally contains no private OpenClaw IDs, no hard-coded user paths, no API keys, and no channel recipient IDs. It reads provider configuration from the local OpenClaw config at runtime.

安全使用建议
Before installing, confirm that the OpenClaw provider configuration points to the image provider you intend to use, that the API key is appropriate for image generation, and that you are comfortable with prompts and generated files being stored locally in run/output directories.
功能分析
Type: OpenClaw Skill Name: happy-img2-direct Version: 1.0.0 The skill is a well-structured tool for generating images via OpenAI-compatible APIs, featuring robust error handling, retries with exponential backoff, and batch processing capabilities. It demonstrates good security hygiene by explicitly redacting API keys and sensitive tokens from logs and error messages in both `scripts/generate-image.js` and `scripts/run.py`. The code aligns with its stated purpose and lacks any indicators of malicious intent or unauthorized data access.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The declared purpose is image generation via an OpenAI-compatible provider, and the code matches that purpose by calling a configured /images/generations endpoint. Provider credential use is expected for this function.
Instruction Scope
The instructions describe explicit user-invoked single or batch generation commands, bounded retries, and bounded batch concurrency with a hard maximum of 4 workers.
Install Mechanism
There is no install script or remote download path; the skill uses included Python and Node scripts and requires python3 and node to be present.
Credentials
The skill reads OpenClaw provider configuration and may read an API key via an environment variable named by that config, then sends prompts to the configured provider. This is proportionate to image generation but should be understood by users.
Persistence & Privilege
Generated images, request metadata, prompts, stdout/stderr, and result JSON files are persisted under local output/run directories. No background persistence, privilege escalation, or autonomous delivery is shown.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install happy-img2-direct
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /happy-img2-direct 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial public release: OpenAI-compatible image generation wrapper with retries and bounded batch concurrency.
元数据
Slug happy-img2-direct
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Happy IMG2 Direct 是什么?

Generate images with an OpenAI-compatible image provider such as happy/gpt-image-2, with retries and bounded batch concurrency. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 88 次。

如何安装 Happy IMG2 Direct?

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

Happy IMG2 Direct 是免费的吗?

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

Happy IMG2 Direct 支持哪些平台?

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

谁开发了 Happy IMG2 Direct?

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

💬 留言讨论