
- Installs
- 286
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/redfox-data/redfox-community --skill image-gen- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads image-gen automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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等旧写法,脚本内部自动映射到宽高比 + 档位
使用方式
文生图 — 输入文字生成图片
# 基本生成(默认 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
图生图 — 上传参考图编辑生成
# 单张参考图(自动上传 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"
其他操作
# 仅提交任务(返回 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 | 新接口不再支持保真度控制 |
依赖安装
| 依赖 | 安装命令 |
|---|---|
requests | pip3 install requests |
首次使用
先配置 API Key,然后运行:
# 设置环境变量
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
请求体:
{
"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.status | completed / 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 字,超过会被阻断并提示精简。
FAQ
What does the image-gen skill do?
AI 图片生成器 — 基于 gpt-image-2 模型,支持文生图与图生图,开箱即用。
How do I install image-gen?
Run npx skills add https://github.com/redfox-data/redfox-community --skill image-gen in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/image-gen/ (personal) or .claude/skills/image-gen/ (project).
Which AI agents can use image-gen?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is image-gen safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains image-gen?
It is published by redfox-data in redfox-data/redfox-community. It has 286 recorded installs.
More from redfox-data/redfox-community
wechat-10w-hot
redfox-data/redfox-community
全网持续收录每日超过1000+公众号10w+文章内容,向用户推送公众号达到10w+阅读的热门文章;当用户需要获取全领域的公众号热门文章、或订阅每日10w+文章推送、特定领域爆款文章时使用
douyin-search
redfox-data/redfox-community
抖音作品查询工具。根据关键词搜索抖音热门爆款作品,支持按日期范围筛选,结果以结构化表格展示。当用户查找抖音热门内容、搜索抖音爆款视频、查询抖音作品数据时使用。触发词:抖音作品查询、抖音爆款、抖音热门、抖音热榜、抖音搜索、爆款视频、热门视频。当接口返回积分不足(code=3210)时,自动唤起支付宝完成充值后继续查询。
xiaohongshu-search
redfox-data/redfox-community
小红书热门笔记搜索工具,支持关键词搜索获取热门内容数据,基于数据评分排序推荐热门笔记,助力创作者发现热门趋势、获取创作灵感。仅在主Agent中执行,不派发给子Agent。当接口返回积分不足(code=3210)时,自动唤起支付宝完成充值后继续查询。
douyin-hot-trend
redfox-data/redfox-community
专注于获取抖音最新的热榜数据,每小时更新,包含热点事件、热度值和跳转链接;支持查询近7天、近30天历史热榜,并支持订阅定时推送。
douyin-account-diagnosis
redfox-data/redfox-community
一键诊断抖音账号运营健康度。基于红狐数据服务获取账号画像与近期作品数据,从账号基础画像、内容生产力、互动健康度、内容质量、内容趋势、粉丝质量六个维度进行量化诊断,输出100分制综合评分、维度得分明细、六类风险预警和针对性优化建议。触发词:当用户提到'诊断抖音账号'、'抖音账号分析'、'抖音体检'、'抖音账号评估'、'查看XX抖音数据'、'分析这个抖音号'时使用
xiaohongshu-crawler
redfox-data/redfox-community
小红书作品爬取工具。根据关键词爬取小红书热门作品数据,支持按日期范围、排序方式筛选,结果以结构化表格展示。当用户需要爬取小红书作品、查询小红书热门内容、搜索小红书爆款笔记时使用。触发词:小红书爬取、小红书作品、小红书爆款、小红书搜索、小红书热门、小红书笔记查询。当接口返回积分不足(code=3210)时,自动唤起支付宝完成充值后继续查询。
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image
ai-avatar-video
101-skills/superpowers
Create AI avatar and talking head videos via inference.sh CLI. Recommended: P-Video-Avatar (fastest, cheapest, built-in TTS). Also: OmniHuman, Fabric, PixVerse. Audio: Inworld TTS-2 (100+ languages, emotion steering for characters), ElevenLabs, Kokoro. Capabilities: audio-driven avatars, text-to-avatar, lipsync videos, talking head generation, virtual presenters, UGC content. Use for: AI presenters, explainer videos, virtual influencers, dubbing, marketing videos, UGC ads, gaming avatars, NPC dialogue. Triggers: ai avatar, talking head, lipsync, avatar video, virtual presenter, ai spokesperson, audio driven video, heygen alternative, synthesia alternative, talking avatar, lip sync, video avatar, ai presenter, digital human, ugc, ugc video, ugc ad, avatar ugc