SuperAPI AI Directory

gpt-image2-pro

Design & creation

View repository

Updated 10-16 04:42

About this skill

AI Image Generator

Call OpenAI's latest gpt-image-2 model to generate high-quality images. Built-in free quota, just paste a prompt and use it.

Skill Features

  • Built-in public API Key, ready to use out of the box, about 10000 free uses
  • No additional subscription or credit card required
  • Supports command-line batch generation, parameterized control of size/format/background
  • Text-to-image + image-to-image dual mode,--image one parameter enables edit mode
  • After the quota is used up, go to Red Fox Hub to register and get free Tokens to continue using

Capability Overview

  • Text-to-image: input a prompt to generate a brand-new image
  • Image-to-image: upload a reference image + prompt, edit and generate based on the original image
  • Model: gpt-image-2 (OpenAI's latest image model)
  • Output format:PNG、JPEG、WebP
  • Size support: 1024x1024, 1024x1792, 1792x1024 and auto
  • Batch generation: up to 10 images per run
  • Transparent background: supports PNG/WebP transparent background output
  • Fidelity control: image-to-image supports high/low fidelity

How to Use

Text-to-image — input text to generate an image

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

Image-to-image — upload a reference image to edit and generate

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

Other Operations

# 仅提交任务(返回 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

Parameter Description

Parameter Description Default Value
prompt Generation/edit prompt (required) -
--image Reference image path (enables image-to-image mode) -
--fidelity Image-to-image fidelity:high / low -
--size Size 1024x1024
-n, --count Number to generate (1-10) 1
--quality Quality:low / medium / high / auto medium
--format Format:png / jpeg / webp png
--bg Background:transparent / opaque / auto auto
--compression Compression ratio (0-100) 0
-o, --output-dir Output directory ~/Downloads/QoderImages
--prefix Filename prefix image
--no-download Submit only without waiting -
--task-id Query an existing task -
--api-key Specify API Key -

Dependency Installation

Dependency Installation Command
requests pip3 install requests

First Use

Ready to use out of the box — no configuration required

The script has a built-in public API Key, providing about 10000 free uses. Just run the example command directly, zero configuration and zero cost.

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

Subsequent Use

After the public Key quota is used up, go to Red Fox Hub to register an account and get your own API Token. Choose any one of the three configuration methods:

Configuration Method Description Command
Environment variable(recommended) Set once, takes effect globally export REDFOX_API_KEY=ak_你的密钥
Command-line parameter Temporary use, takes effect for a single run python3 "$SKILL_PATH/assets/imagegen.py" "prompt" --api-key ak_你的密钥
Configuration file Persistent storage, retained across sessions mkdir -p ~/.qoder/apis && echo '{"api_key":"ak_你的密钥"}' > ~/.qoder/apis/redfox.json

FAQ

Q: What are the features of this Skill? A: Directly call the gpt-image-2 model from the command line, supporting batch generation, parameterized control, and image-to-image editing, with built-in free quota ready to use out of the box.

Q: How long does it take to generate an image? A: Usually 10-30 seconds, and complex scenes may take longer. The script will automatically poll and wait.

Q: How do I choose the fidelity for image-to-image? A:--fidelity high Try to preserve the original image details (minor adjustments),--fidelity low allow major changes (style transfer). If not specified, the model will decide on its own.

Q: How do I generate an image with a transparent background? A: Use --bg transparent, together with PNG or WebP format (JPEG does not support transparency).

Q: What should I do when the quota runs out? A: Go to Red Fox Hub to register and get your own API Token.

Q: What image formats are supported as reference images? A: Local image files in PNG, JPEG, and WebP formats are supported.