文本生成图片
draw-image
使用与 OpenAI 兼容的图像生成 API(gpt-image-1-mini 或兼容模型)根据文本提示生成图像。图像会上传到 gofile.io 公共文件分享服务,且仅返回公开的下载页面 URL。当用户要求绘制、绘画、生成或创建图像时触发。
- License 许可
- MIT
- 所属仓库
- ai-sns/ai-sns
- 最近更新
- 2026-08-05
- Stars
- ★ 327
- Forks
- 11
01 前言 Front Matter
- name
- draw-image
- metadata
- { "openclaw": { "emoji": "?", "install": [ { "id": "python-brew", "bins": [ "python3" ], "kind": "brew", "label": "Install Python (brew)", "formula": "python" } ], "requires": { "bins": [ "python3" ] } } }
- description
- Generate an image from a text prompt using an OpenAI-compatible image generation API (gpt-image-1-mini or compatible). The image is uploaded to the gofile.io public file sharing service and ONLY the public download page URL is returned. Trigger when user asks to draw, paint, generate, or create an image.
02 资源文件 1
- 脚本scripts/draw.py10.6 KB
03 SKILL.md 正文
Draw Image
Generate images via an OpenAI-compatible images/generations endpoint. The script has a built-in API base and key, so no extra configuration is needed.
Quick Start
Generate an image from a text prompt:
python3 ~/.hermes/skills/ai-sns/draw-image/scripts/draw.py --prompt "A futuristic cityscape at sunset with flying cars"
Parameters
All parameters are optional except --prompt:
python3 ~/.hermes/skills/ai-sns/draw-image/scripts/draw.py \
--prompt "A cute cat wearing a spacesuit" \
--size 1024x1024 \
--model gpt-image-1-mini\
--quality low \
--n 1
\n- --prompt: Text description of the image (required).
--size: Image dimensions (optional). Default is1024x1024.--model: Image generation model (optional). Default isgpt-image-1-mini.--quality: Image quality, eitherlow,medium,high(optional). Default islow.--n: Number of images to generate (optional). Default is1.--out-dir(string, optional): Directory to save images. Default:<projectRoot>/uploads/generated_images/.--api-base(string, optional): Override the API base URL.--api-key(string, optional): Override the API key.
Stdin JSON Mode
Alternatively, pass parameters as JSON on stdin:
echo '{"prompt": "A serene mountain landscape at dawn"}' | python3 ~/.hermes/skills/ai-sns/draw-image/scripts/draw.py --stdin
Environment Variable Overrides
DRAW_IMAGE_API_BASE: Override the API base URL.DRAW_IMAGE_API_KEY: Override the API key.
Draw a Cow
Generate an image of a cow with the following command:
python3 ~/.hermes/skills/ai-sns/draw-image/scripts/draw.py --prompt 'A cow' --size 1024x1024 --model gpt-image-1-mini --quality low
The image is generated, uploaded to gofile.io, and ONLY the public download page URL is returned. The script prints a JSON object to stdout:
ok(bool): Whether the generation and upload succeeded.download_page(string): The public gofile.io download page URL of the generated image. Only this URL is returned as the result. Open this URL in a browser to download the generated image.note(string): A short hint explaining thatdownload_pageis used to download the generated image.error(string): Error message on failure.
Example success output:
{
"ok": true,
"download_page": "https://gofile.io/d/WcWZKt",
"note": "Use this URL to download the generated image."
}
04 同仓库更多 Skills
回显参数示例技能
Echo Skill Sample
将输入参数以 JSON 格式回显。
A2A 智能体卡片获取
Fetch Agent Card
从给定的端点 URL 获取 A2A 智能体卡片 JSON。先尝试直接 GET,若失败则回退到 /.well-known/agent.json。
A2A JSON-RPC 端点调用
A2A JSON-RPC Call
调用对等智能体的 A2A JSON-RPC 端点。支持 tasks/send(发送任务消息)和 tasks/get(查询任务状态)。
文本提示词生成图像
Draw Image
使用默认的类 OpenAI LLM 配置(gpt-image-1-mini 或兼容的图像生成 API)根据文本提示词生成图像。图像会上传到 gofile.io 公共文件分享服务,并且仅返回公共下载页面的 URL。
文本生成图片
draw-image
使用与 OpenAI 兼容的图像生成 API(gpt-image-1-mini 或兼容模型)根据文本提示生成图像。图像会上传到 gofile.io 公共文件分享服务,且仅返回公开的下载页面 URL。当用户要求绘制、绘画、生成或创建图像时触发。