ClawHub
SkillsPluginsTemplatesDocsSupport
K
SkillsGPT-image2

GPT-image2

RedFox@redfox-data
Install in OpenClaw
Requires OpenClaw desktop app
AI 图片生成器 — 基于 gpt-image-2 模型,支持文生图与图生图,开箱即用。
Security check
Review
Version
1.0.4
Updated
Jun 23, 2026
License
MIT-0

Latest: v1.0.4

  • 改进 API Key 获取和注册指引,将相关说明中的链接由 source=github 更新为 source=clawhub
  • README 文件中的 API 地址和使用指引同步进行了修订更新
  • 文档内容保持一致性,无功能或参数变更
Creative
#图片生成

GPT-image2

调用 OpenAI 最新的 gpt-image-2 模型生成高质量图片。粘贴提示词就能用。

Skill 特色

  • 支持命令行批量生成、参数化控制尺寸/格式/背景
  • 文生图 + 图生图双模式,--image 一个参数启用编辑模式

能力概述

  • 文生图:输入提示词,生成全新图片
  • 图生图:上传参考图 + 提示词,基于原图编辑生成
  • 模型:gpt-image-2(OpenAI 最新图像模型)
  • 输出格式:PNG、JPEG、WebP
  • 尺寸支持:仅支持测试验证过的分辨率(自定义分辨率可能导致生成过慢或失败)
    • 快速档:1024x1024(1:1)、1024x1536(2:3 竖版)、1536x1024(3:2 横版)、1792x1024(16:9 横版)、1024x1792(9:16 竖版,默认)
    • 高清档(画质更高,生成更慢):2048x2048、2048x1152、1152x2048
  • 批量生成:单次最多 10 张
  • 透明背景:支持 PNG/WebP 透明背景输出
  • 保真控制:图生图支持 high/low 保真度

使用方式

文生图 — 输入文字生成图片

bash
# 基本生成
python3 "$SKILL_PATH/assets/imagegen.py" "一只橘色的猫咪坐在窗台上看着窗外的夕阳"

# 横版高清
python3 "$SKILL_PATH/assets/imagegen.py" "futuristic city skyline" --size 1792x1024

# 透明背景 logo
python3 "$SKILL_PATH/assets/imagegen.py" "minimalist cat logo, flat design" --bg transparent --format png

# 批量生成 4 张
python3 "$SKILL_PATH/assets/imagegen.py" "icon set, flat style" -n 4 --bg transparent

# WebP + 压缩
python3 "$SKILL_PATH/assets/imagegen.py" "product photo on white background" --format webp --compression 50

图生图 — 上传参考图编辑生成

bash
# 基于参考图修改(自动上传图片 → 编辑生成)
python3 "$SKILL_PATH/assets/imagegen.py" "把猫咪改成白色,背景换成星空" --image ~/Pictures/cat.png

# 风格迁移,高保真
python3 "$SKILL_PATH/assets/imagegen.py" "改成赛博朋克风格" --image ref.jpg --fidelity high

# 低保真,大幅改动
python3 "$SKILL_PATH/assets/imagegen.py" "变成水彩画风格,加入樱花元素" --image photo.png --fidelity low

其他操作

bash
# 仅提交任务(返回 taskId,不等待)
python3 "$SKILL_PATH/assets/imagegen.py" "complex scene" --no-download

# 查询已有任务结果
python3 "$SKILL_PATH/assets/imagegen.py" "" --task-id sfwmpic7xxxxxxxx

# 指定输出目录和文件名前缀
python3 "$SKILL_PATH/assets/imagegen.py" "illustration" -o ~/Pictures/AI --prefix artwork

参数说明

参数说明默认值
prompt生成/编辑提示词(必填,最多 500 字)-
--image参考图路径(启用图生图模式)-
--fidelity图生图保真度:high / low-
--size尺寸(仅支持白名单分辨率)1024x1792
-n, --count生成数量(1-10)1
--quality质量:low / medium / high / automedium
--format格式:png / jpeg / webppng
--bg背景:transparent / opaque / autoauto
--compression压缩比(0-100)0
-o, --output-dir输出目录~/Downloads/QoderImages
--prefix文件名前缀image
--no-download仅提交不等待-
--task-id查询已有任务-
--api-key指定 API Key-

依赖安装

依赖安装命令
requestspip3 install requests

首次使用

先配置 API Key,然后运行:

bash
# 设置环境变量
export REDFOX_API_KEY=ak_你的密钥

# 运行
python3 "$SKILL_PATH/assets/imagegen.py" "一只橘色的猫咪"

前往 redfox.hk 注册获取 API Key。


后续使用

前往 redfox.hk 注册账号获取自己的 API Token,三种配置方式任选其一:

配置方式说明命令
环境变量(推荐)设置一次,全局生效export REDFOX_API_KEY=ak_你的密钥
命令行参数临时使用,单次生效python3 "$SKILL_PATH/assets/imagegen.py" "prompt" --api-key ak_你的密钥
配置文件持久化存储,跨会话保留mkdir -p ~/.qoder/apis && echo '{"api_key":"ak_你的密钥"}' > ~/.qoder/apis/redfox.json

常见问题

Q:本 Skill 的特点是什么? A:命令行直接调用 gpt-image-2 模型,支持批量生成、参数化控制、图生图编辑,

Q:生成一张图片需要多久? A:通常 10-30 秒,复杂场景可能更久。脚本会自动轮询等待。

Q:图生图的保真度怎么选? A:--fidelity high 尽量保留原图细节(微调),--fidelity low 允许大幅改动(风格迁移)。不传则由模型自行判断。

Q:如何生成透明背景图? A:使用 --bg transparent,搭配 PNG 或 WebP 格式(JPEG 不支持透明)。

Q:如何获取 API Key? A:前往 redfox.hk 注册获取自己的 API Token。

Q:支持哪些图片格式作为参考图? A:支持 PNG、JPEG、WebP 格式的本地图片文件。

Q:支持自定义分辨率吗? A:仅支持以下测试验证过的分辨率,其他分辨率可能导致生成过慢或失败:

  • 快速档:1024x1024、1024x1536、1536x1024、1792x1024、1024x1792(默认)
  • 高清档(画质更高,生成更慢):2048x2048、2048x1152、1152x2048

Q:提示词有长度限制吗? A:提示词最多支持 500 字,超过会被阻断并提示精简。

Related skills

More in Creative
ClawHub

Skills and plugins for OpenClaw agents. Part of the wider OpenClaw ecosystem.

Explore docs

SkillsPluginsTemplatesOfficialAudits

Publish SkillPublish PluginCreate org

OverviewOpenClawDocsBlog

SupportGitHubDiscord

Built alongside the OpenClaw ecosystem

LobsterCrabboxClickClackCrabfleetOctopoolClawSweeperagent-skillsdiscrawlgitcrawlslacrawlnotcrawltelecrawlgraincrawlcrawlkitcrawlbaracpxmcporterTachikomaclawpatchclawbenchPeekaboocookbookplugin-inspectorwacrawlcrabpotAll projectsLobsterCrabboxClickClackCrabfleetOctopoolClawSweeperagent-skillsdiscrawlgitcrawlslacrawlnotcrawltelecrawlgraincrawlcrawlkitcrawlbaracpxmcporterTachikomaclawpatchclawbenchPeekaboocookbookplugin-inspectorwacrawlcrabpotAll projects

© 2026 OpenClaw Foundation

Privacy policy·Status·Deployed on Vercel·Powered by Convex

....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals
  hooks runners slash-commands skill.md templates scanners review-bots     safe browse paths   official gateways   publisher handles   org trust   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@
openclaw ecosystem    crabbox clickclack crawler packs gateway plugins   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship
---- downloads installs stars lineage ownership docs package integrity   >>> install scan publish verify    @@ gateway @@ registry @@ agents @@   :::: signed manifests ::::: moderated releases ::::: version history ::::
  safe browse paths   official gateways   publisher handles   org trust     30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship     hooks runners slash-commands skill.md templates scanners review-bots
....:: clawhub/openclaw ::....  skills plugins publishers trust signals   :::: signed manifests ::::: moderated releases ::::: version history ::::   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins
>>> install scan publish verify    @@ gateway @@ registry @@ agents @@     hooks runners slash-commands skill.md templates scanners review-bots   ---- downloads installs stars lineage ownership docs package integrity
  30 skills 12 plugins    /api/v1/skills   /owners   /audit   /ship   openclaw ecosystem    crabbox clickclack crawler packs gateway plugins     safe browse paths   official gateways   publisher handles   org trust
:::: signed manifests ::::: moderated releases ::::: version history ::::   ---- downloads installs stars lineage ownership docs package integrity   ....:: clawhub/openclaw ::....  skills plugins publishers trust signals