闲社服务运行正常AI智能体自动化平台
i

图像生成

技能标识:image-generation

图像生成辅助。支持通过 OpenRouter 直接调用各种生图模型(如 Seedream),为 OpenClaw 优化,支持提示词、尺寸等参数配置。目前仅限 OpenRouter provider。

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 0.2.1
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

图像生成

图像生成辅助

为 OpenClaw 提供原生的图像生成能力,通过文字描述词快速生成高质量图像。

工作流程

用户提示词 (Prompt)
↓
┌─────────────────────────────────────┐
│ 识别参数:模型、尺寸、比例、路径 │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ 调用 OpenRouter 接口 (OpenClaw) │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ 默认模型:seedream-4.5 (Text-to-Image) & Gemini 2.5 (Image-to-Image) │
└─────────────────────────────────────┘
↓
┌─────────────────────────────────────┐
│ 原子化写入本地存储 (Safety First) │
└─────────────────────────────────────┘
↓
返回结构化 JSON (Success Payload)

安装与配置

1. 获取 API Key

本技能需要 OpenRouter API Key 才能调用图像生成服务。

  1. 1. 访问 OpenRouter 控制台 创建 API Key
  2. 请根据下方指引手动配置环境变量

2. 配置到环境变量

根据 OpenClaw 官方最佳实践,请通过 ~/.openclaw/openclaw.json 配置环境变量:

json5
{
skills: {
entries: {
image-generation: {
enabled: true,
env: {
OPENROUTERAPIKEY: sk-or-v1-xxxxxxxx...
}
}
}
}
}

或使用 primaryEnv 快捷配置:

json5
{
skills: {
entries: {
image-generation: {
enabled: true,
apiKey: sk-or-v1-xxxxxxxx...
}
}
}
}

配置完成后无需重启,新配置会在下次运行 OpenClaw 时自动生效。

3. 选择默认模型(可选)

本技能默认使用 bytedance-seed/seedream-4.5 作为文本生图模型,google/gemini-2.5-flash-image 作为图生图模型。你可以通过以下方式更改:

方式一:环境变量配置
在 ~/.openclaw/openclaw.json 中添加:
json5
{
skills: {
entries: {
image-generation: {
enabled: true,
env: {
OPENROUTERAPIKEY: sk-or-v1-xxx,
IMAGEGENTEXTTOIMAGE_MODEL: bytedance-seed/seedream-4.5,
IMAGEGENIMAGETOIMAGE_MODEL: google/gemini-2.5-flash-image
}
}
}
}
}

本技能默认使用 bytedance-seed/seedream-4.5 模型,你可以通过以下方式更改:

方式一:环境变量配置
在 ~/.openclaw/openclaw.json 中添加:
json5
{
skills: {
entries: {
image-generation: {
enabled: true,
env: {
OPENROUTERAPIKEY: sk-or-v1-xxx,
IMAGEGENIMAGETOIMAGE_MODEL: google/gemini-2.5-flash-image,
IMAGEGENTEXTTOIMAGE_MODEL: bytedance-seed/seedream-4.5
}
}
}
}

方式二:查看可用模型
bash
node skills/image-generation/scripts/cli/openrouter.js --list-models

方式三:生成时指定模型
bash
node skills/image-generation/scripts/generate.js \
--prompt a futuristic city \
--model bytedance-seed/seedream-4.5 \
--i2i-model google/gemini-2.5-flash-image

bash
node skills/image-generation/scripts/generate.js \
--prompt a futuristic city \
--image bytedance-seed/seedream-4.5 \
--model google/gemini-2.5-flash-image

推荐模型:

  • - bytedance-seed/seedream-4.5 - 默认,高质量图像生成
  • anthropic/claude-3.5-sonnet-image - Claude 图像生成
  • openai/dall-e-3 - DALL-E 3

4. 验证配置

bash
node skills/image-generation/scripts/cli/openrouter.js --test

预期输出:
json
{
success: true,
message: OpenRouter API key is configured. Test passed.
}

核心配置

仅限 OpenRouter (v1)

本技能在 v1 版本中仅支持通过 OpenRouter 提供商进行图像生成。目前不原生支持 Anthropic、Replicate 或 Stability AI 等直接接口。所有生图请求均通过 OpenRouter 统一中转。

默认模型

OpenClaw 调用方式

命令调用

OpenClaw 会通过以下 CLI 方式触发图像生成:

bash

基础生成


node skills/image-generation/scripts/generate.js \
--prompt a futuristic city at sunset \
--output outputs/city.png

指定模型、尺寸与比例 (OpenRouter 默认)

node skills/image-generation/scripts/generate.js \ --prompt cyberpunk landscape \ --model bytedance-seed/seedream-4.5 \ --i2i-model google/gemini-2.5-flash-image \ --size 2K \ --aspect 16:9

node skills/image-generation/scripts/generate.js \
--prompt cyberpunk landscape \
--image bytedance-seed/seedream-4.5 \
--model google/gemini-2.5-flash-image \
--size 2K \
--aspect 16:9

通过 OpenClaw 包装器调用

node skills/image-generation/scripts/cli/openrouter.js \ --prompt abstract oil painting \ --size 1K

预检测 (Connectivity Check)

OpenClaw 在启动时可运行以下脚本检查 API 连通性:

bash
node skills/image-generation/scripts/cli/openrouter.js --test

参数详解

参数说明必填默认值
--prompt图像描述词是-
--model
文本生图模型 ID | 否 | bytedance-seed/seedream-4.5 | | --i2i-model | 图生图模型 ID | 否 | google/gemini-2.5-flash-image | | --input-image| 图生图输入图片路径 | 否 | - | | --list-models | 列出所有可用模型 | 否 | - | | --size | 分辨率等级 (1K\|2K\|4K) | 否 | 模型默认 | | --aspect | 宽高比 (如 1:1, 16:9) | 否 | 1:1 | | --output | 输出文件路径 | 否 | .sisyphus/generated/image_.png |

|------|------|------|--------|
| --prompt | 图像描述词 | 是 | - |
|| --model | 图生图模型 ID | 否 | google/gemini-2.5-flash-image |
|| --image | 文本生图模型 ID | 否 | bytedance-seed/seedream-4.5 |
| --list-models | 列出所有可用模型 | 否 | - |
| --size | 分辨率等级 (1K\|2K\|4K) | 否 | 模型默认 |
| --aspect | 宽高比 (如 1:1, 16:9) | 否 | 1:1 |
| --output | 输出文件路径 | 否 | .sisyphus/generated/image_.png |
| --output | 输出文件路径 | 否 | .sisyphus

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 phoenixclaw-image-gen-1776303010 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 phoenixclaw-image-gen-1776303010 技能

通过命令行安装

skillhub install phoenixclaw-image-gen-1776303010

下载

⬇ 下载 image-generation v0.2.1(免费)

文件大小: 20.05 KB | 发布时间: 2026-4-16 15:43

v0.2.1 最新 2026-4-16 15:43
- Added a new resolution and aspect ratio guide at references/resolution-guide.md.
- Updated recommended usage: the --size parameter now only accepts "1K", "2K", or "4K" (not pixel values).
- Documented the allowed --size values, the actual pixel outputs, supported aspect ratios, and model/resolution restrictions.
- Clarified that some models do not support 4K, and 2K is the recommended daily setting.
- Improved parameter documentation for size and aspect to align with OpenRouter API limitations.
返回顶部