happy_img2_direct
Generate images with an OpenAI-compatible image provider such as happy/gpt-image-2, with retries and bounded batch concurrency.
- License 许可
- MIT
- 最近更新
- 2026-06-10
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- happy_img2_direct
- version
- 1.0.0
- metadata
- { "openclaw": { "emoji": "🖼️", "requires": { "bins": [ "python3", "node" ], "config": [ "models.providers" ] } } }
- description
- Generate images with an OpenAI-compatible image provider such as happy/gpt-image-2, with retries and bounded batch concurrency.
03 SKILL.md 正文
Happy IMG2 Direct Skill
Generate real images through an OpenAI-compatible /images/generations endpoint configured in OpenClaw.
Default behavior:
- provider:
happyunlessOPENCLAW_IMAGE_PROVIDERis set - model:
gpt-image-2unlessOPENCLAW_IMAGE_MODELis set - size:
1024x1024 - timeout:
600000msper 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:
--promptrequired--task-nameoutput filename prefix--providerprovider key in OpenClaw config, defaulthappy--modelimage model, defaultgpt-image-2--sizedefault1024x1024--timeout-msdefault600000--output-dirdefault~/.openclaw/generated-images--max-attemptsdefault3, maximum5--retry-base-delay,--retry-max-delay,--retry-jitter--rawmarker for callers that intentionally keep the user prompt unchanged--no-sendaccepted 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.jsonrecords 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.
04 同仓库更多 Skills
youtube-content
YouTube transcripts to summaries, threads, blogs.
xurl
X/Twitter via xurl CLI: post, search, DM, media, v2 API.
touchdesigner-mcp
Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.
test-driven-development
TDD: enforce RED-GREEN-REFACTOR, tests before code.
teams-meeting-pipeline
Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.