Image Gen logo

Image Gen

Community
redfox-data
image-gen

AI 图片生成器 — 基于 gpt-image-2 模型,支持文生图与图生图,开箱即用。

Overview

Publisherredfox-data
Repositoryredfox-community
Skill nameimage-gen
Stars
449
Forks
59
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by redfox-data on GitHub. Read the source before you install it.

Installation

Install the Image Gen AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/redfox-data/redfox-community/tree/main/skills/image-gen
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/redfox-data/redfox-community.git /tmp/redfox-community
mkdir -p .claude/skills
cp -r /tmp/redfox-community/skills/image-gen .claude/skills/image-gen
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Image Gen in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Image Gen on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Image Gen is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

GPT-image2

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

Skill 特色

  • 支持命令行批量生成、参数化控制宽高比与分辨率档位
  • 文生图 + 图生图双模式,--image 一个参数启用编辑模式(最多 2 张参考图)

能力概述

  • 文生图:输入提示词,生成全新图片
  • 图生图:上传参考图(最多 2 张) + 提示词,基于原图编辑生成
  • 模型:gpt-image-2(OpenAI 最新图像模型)
  • 接口:红狐新版 gptImage2Submit / gptImage2Result
  • 输出格式:PNG(新接口固定输出)
  • 宽高比:1:1 / 3:2 / 2:3 / 4:3 / 3:4 / 5:4 / 4:5 / 16:9(默认) / 9:16 / 2:1 / 1:2 / 21:9 / 9:21
  • 分辨率档位:1k / 2k(默认) / 4k
  • 批量生成:单次最多 4 张(新接口上限)
  • 兼容旧像素格式:仍接受 1792x1024 等旧写法,脚本内部自动映射到宽高比 + 档位

使用方式

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

bash
# 基本生成(默认 16:9 + 2k)
python3 "$SKILL_PATH/assets/imagegen.py" "一只橘色的猫咪坐在窗台上看着窗外的夕阳"

# 横版 4k 高清
python3 "$SKILL_PATH/assets/imagegen.py" "futuristic city skyline" --size 16:9 --resolution 4k

# 竖版小红书封面(3:4 + 2k)
python3 "$SKILL_PATH/assets/imagegen.py" "product cover, minimal style" --size 3:4 --resolution 2k

# 方形 1k 快速档
python3 "$SKILL_PATH/assets/imagegen.py" "minimalist cat logo, flat design" --size 1:1 --resolution 1k

# 批量生成 4 张(新接口上限)
python3 "$SKILL_PATH/assets/imagegen.py" "icon set, flat style" -n 4

# 兼容旧像素写法(自动映射为 16:9 + 1k)
python3 "$SKILL_PATH/assets/imagegen.py" "cyberpunk street" --size 1792x1024

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

bash
# 单张参考图(自动上传 OSS → 提交任务)
python3 "$SKILL_PATH/assets/imagegen.py" "把猫咪改成白色,背景换成星空" --image ~/Pictures/cat.png

# 两张参考图(新接口最多支持 2 张)
python3 "$SKILL_PATH/assets/imagegen.py" "融合两张图的风格" --image ref1.png --image ref2.jpg

# 直接使用 URL 参考图(跳过上传步骤)
python3 "$SKILL_PATH/assets/imagegen.py" "把海报主体换成手表" --image "https://example.com/poster.jpg"

其他操作

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

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

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

参数说明

参数说明默认值
prompt生成/编辑提示词(必填,最多 500 字)-
--size宽高比(如 16:9);也兼容旧像素格式(如 1792x1024)16:9
--resolution分辨率档位:1k / 2k / 4k像素格式自动匹配;宽高比默认 2k
-n, --count生成数量(1-4,新接口上限 4)1
--image参考图路径或 URL(可多次传入,最多 2 张)-
-o, --output-dir输出目录~/Downloads/QoderImages
--prefix文件名前缀image
--no-download仅提交不等待-
--task-id查询已有任务-
--api-key指定 API Key-

已弃用参数(新接口不再支持,传入会被忽略并给出提示)

参数说明
--quality用 --resolution 代替
--format新接口固定输出 PNG
--bg / --background新接口不再支持背景控制
--compression新接口不再支持压缩比
--fidelity新接口不再支持保真度控制

依赖安装

依赖安装命令
requestspip3 install requests

首次使用

先配置 API Key,然后运行:

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

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

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

⚠️ 新接口仅支持付费调用,账户免费积分无法抵扣本接口。若返回错误码 3203,请前往 充值页面 补充付费积分。


后续使用

前往 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

接口规格(新)

提交任务

POST https://redfox.hk/story/api/parseWork/imageGen/gptImage2Submit

请求头:REDFOX_API_KEY: ak_xxx + Content-Type: application/json

请求体:

json
{
  "prompt": "把这个海报的主体变为手表 并把文字都用中文",
  "resolution": "2k",
  "size": "16:9",
  "n": 2,
  "referenceImages": ["https://example.com/poster.jpg"]
}

响应:data.taskId 用于后续轮询。

查询结果

POST https://redfox.hk/story/api/parseWork/imageGen/gptImage2Result

请求体:{"taskId": "..."}

响应关键字段:

字段说明
data.statuscompleted / processing / queued / failed
data.progress生成进度 0-100
data.imageUrls生成结果 URL 数组(数量与 n 一致)
data.failReason失败原因(成功时为 null)
data.model使用的模型(gpt-image-2)
data.resolution / data.size实际使用的档位与宽高比

常见问题

Q:本 Skill 的特点是什么? A:命令行直接调用 gpt-image-2 模型,支持批量生成、宽高比与分辨率档位控制、图生图(最多 2 张参考图)。

Q:生成一张图片需要多久? A:通常 10-60 秒,4k 档位或复杂场景可能更久。脚本会自动轮询等待并展示 progress。

Q:新的 resolution 与旧的 quality 有什么区别? A:resolution 是分辨率档位(1k/2k/4k),直接决定输出图像的清晰度与生成耗时;旧的 quality 参数已弃用,传入会被忽略。

Q:为什么 --size 从像素改成了宽高比? A:新接口 gptImage2Submit 的 size 字段就是宽高比(如 16:9)。为兼容旧调用,脚本仍接受 1792x1024 等像素写法,内部自动映射到宽高比 + 推荐档位。

Q:图生图能传几张参考图? A:新接口最多 2 张。多次传入 --image 即可,超出部分会被截断并提示。

Q:为什么调用返回错误码 3203? A:新接口仅支持付费调用,账户免费积分不可抵扣。请前往 redfox.hk/dashboard/recharge 充值付费积分。

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

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

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Image Gen AI skill do?

AI 图片生成器 — 基于 gpt-image-2 模型,支持文生图与图生图,开箱即用。

Why use Image Gen on TypingMind?

Because you install it once and use it with any model. Image Gen is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Image Gen in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/redfox-data/redfox-community/tree/main/skills/image-gen. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Image Gen?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Image Gen?

As many as you like. As long as a model supports skills, you can use Image Gen with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Image Gen AI skill free?

It is published on GitHub by redfox-data. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇