← Back to Skills Marketplace
redfox-data

GPT-image2

by RedFox · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
32
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install image-gen-redfox
Description
GPT-image2 — 基于 gpt-image-2 模型,支持文生图与图生图,内置免费额度,开箱即用。
README (SKILL.md)

GPT-image2

调用 OpenAI 最新的 gpt-image-2 模型生成高质量图片。内置免费额度,粘贴提示词就能用。

Skill 特色

  • 内置公共 API Key,开箱即用,约 10000 次免费额度
  • 无需额外订阅或绑定信用卡
  • 支持命令行批量生成、参数化控制尺寸/格式/背景
  • 文生图 + 图生图双模式,--image 一个参数启用编辑模式
  • 用完额度后可前往 redfox.hk 注册获取免费 Token 继续使用

能力概述

  • 文生图:输入提示词,生成全新图片
  • 图生图:上传参考图 + 提示词,基于原图编辑生成
  • 模型: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 保真度

使用方式

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

# 基本生成
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

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

# 基于参考图修改(自动上传图片 → 编辑生成)
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

其他操作

# 仅提交任务(返回 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 / auto medium
--format 格式:png / jpeg / webp png
--bg 背景:transparent / opaque / auto auto
--compression 压缩比(0-100) 0
-o, --output-dir 输出目录 ~/Downloads/QoderImages
--prefix 文件名前缀 image
--no-download 仅提交不等待 -
--task-id 查询已有任务 -
--api-key 指定 API Key -

依赖安装

依赖 安装命令
requests pip3 install requests

首次使用

开箱即用 — 无需任何配置

脚本内置公共 API Key,提供约 10000 次免费额度。直接运行示例命令即可,零配置零成本。

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

后续使用

公共 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:额度用完了怎么办? A:前往 redfox.hk 注册获取自己的 API Token。

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

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

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

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

Usage Guidance
Install only if you are comfortable sending prompts, API keys, and any reference images you choose to redfox.hk. Do not use confidential images or regulated data, and set a private output directory if generated files should not remain in Downloads/QoderImages. The built-in public API key is disclosed, but using your own revocable key is safer for account control.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The artifacts consistently describe text-to-image and image-to-image generation, and the Python script implements that purpose by submitting prompts, optionally uploading a user-specified reference image, polling for results, and downloading generated images.
Instruction Scope
The README uses broad natural-language examples, but the executable instructions are explicit CLI commands and there is no automatic background activation shown in the artifacts.
Install Mechanism
No installer, shell bootstrapper, or dependency mutation is present; the only stated dependency is the common Python requests package.
Credentials
The skill sends prompts and optional reference images to redfox.hk and writes images under a default Downloads/QoderImages directory; this is proportionate for image generation but users should avoid sensitive inputs.
Persistence & Privilege
It can read an API key from REDFOX_API_KEY or ~/.qoder/apis/redfox.json and recommends an optional persistent config file, but it does not create persistence automatically or request elevated privileges.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install image-gen-redfox
  3. After installation, invoke the skill by name or use /image-gen-redfox
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of image-gen-redfox using the GPT-image2 model. - Supports both text-to-image and image-to-image generation via command line. - Built-in free quota with public API key, no setup required. - Allows parameter control: resolution, output format, background transparency, batch generation, quality, and more. - Provides easy API key setup for continued use after free quota is spent. - Detailed usage instructions and troubleshooting tips included.
Metadata
Slug image-gen-redfox
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is GPT-image2?

GPT-image2 — 基于 gpt-image-2 模型,支持文生图与图生图,内置免费额度,开箱即用。 It is an AI Agent Skill for Claude Code / OpenClaw, with 32 downloads so far.

How do I install GPT-image2?

Run "/install image-gen-redfox" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is GPT-image2 free?

Yes, GPT-image2 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does GPT-image2 support?

GPT-image2 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created GPT-image2?

It is built and maintained by RedFox (@redfox-data); the current version is v1.0.0.

💬 Comments