gpt-image

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GPT-Image-2

GPT-Image-2

Generate and edit images with OpenAI's GPT-Image-2 via inference.sh CLI.
通过inference.sh CLI使用OpenAI的GPT-Image-2生成和编辑图片。

Quick Start

快速开始

Requires inference.sh CLI (
belt
). Install instructions
bash
belt login

belt app run openai/gpt-image-2 --input '{"prompt": "a cat astronaut floating in space"}'
需要inference.sh CLI(
belt
)。安装说明
bash
belt login

belt app run openai/gpt-image-2 --input '{"prompt": "a cat astronaut floating in space"}'

Capabilities

功能特性

GPT-Image-2 supports text-to-image generation, image editing with reference images, and mask-based inpainting — all through a single model.
FeatureDescription
Text-to-ImageGenerate images from text prompts
Image EditingEdit images using reference images
InpaintingMask-based editing of specific regions
Batch GenerationGenerate up to 10 images at once
Multiple FormatsPNG, JPEG, WebP output
Flexible ResolutionAny size in 32px increments (256–4096)
GPT-Image-2支持文本生成图片、基于参考图的图片编辑以及基于蒙版的图像修复——所有功能都通过单一模型实现。
特性描述
文本生成图片通过文本提示生成图片
图片编辑使用参考图编辑图片
图像修复对特定区域进行基于蒙版的编辑
批量生成一次最多生成10张图片
多种格式输出PNG、JPEG、WebP格式
灵活分辨率支持32像素增量的任意尺寸(256–4096)

Examples

示例

Text-to-Image

文本生成图片

bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "professional product photo of sneakers on a white background, studio lighting",
  "quality": "high"
}'
bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "professional product photo of sneakers on a white background, studio lighting",
  "quality": "high"
}'

Multiple Images

生成多张图片

bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "minimalist logo design for a coffee shop",
  "n": 4,
  "quality": "medium"
}'
bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "minimalist logo design for a coffee shop",
  "n": 4,
  "quality": "medium"
}'

Image Editing with Reference

基于参考图的图片编辑

bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "change the background to a beach at sunset",
  "images": ["https://your-image.jpg"]
}'
bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "change the background to a beach at sunset",
  "images": ["https://your-image.jpg"]
}'

Multi-Image Reference

多参考图编辑

bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "combine these two characters into one scene",
  "images": ["https://character1.jpg", "https://character2.jpg"]
}'
bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "combine these two characters into one scene",
  "images": ["https://character1.jpg", "https://character2.jpg"]
}'

Inpainting with Mask

基于蒙版的图像修复

bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "replace with a red sports car",
  "images": ["https://street-scene.jpg"],
  "mask": "https://car-mask.png"
}'
bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "replace with a red sports car",
  "images": ["https://street-scene.jpg"],
  "mask": "https://car-mask.png"
}'

Custom Resolution

自定义分辨率

bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "wide cinematic landscape, mountains at golden hour",
  "width": 1920,
  "height": 1080,
  "quality": "high"
}'
bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "wide cinematic landscape, mountains at golden hour",
  "width": 1920,
  "height": 1080,
  "quality": "high"
}'

Fast Drafts

快速草稿生成

bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "quick concept sketch of a robot",
  "quality": "low"
}'
bash
belt app run openai/gpt-image-2 --input '{
  "prompt": "quick concept sketch of a robot",
  "quality": "low"
}'

Pricing

定价

Quality~Price per Image
Low$0.006
Medium$0.024
High$0.21
Larger resolutions cost more. See
belt app get openai/gpt-image-2
for full pricing details.
画质单张图片约价
$0.006
$0.024
$0.21
分辨率越高,价格越贵。查看完整定价详情请执行
belt app get openai/gpt-image-2

Parameters

参数

ParameterTypeDefaultDescription
prompt
stringrequiredText prompt describing the image
images
array-Reference image(s) for editing
mask
string-Mask image for inpainting
n
integer1Number of images (1–10)
quality
string-low, medium, or high
width
integer-Output width (256–4096, multiples of 32)
height
integer-Output height (256–4096, multiples of 32)
output_format
stringpngpng, jpeg, or webp
output_compression
integer-Compression level for jpeg/webp (0–100)
参数类型默认值描述
prompt
字符串必填描述图片的文本提示
images
数组-用于编辑的参考图片
mask
字符串-用于图像修复的蒙版图片
n
整数1生成图片数量(1–10)
quality
字符串-low、medium或high
width
整数-输出宽度(256–4096,32的倍数)
height
整数-输出高度(256–4096,32的倍数)
output_format
字符串pngpng、jpeg或webp
output_compression
整数-jpeg/webp的压缩级别(0–100)

Related Skills

相关技能

bash
undefined
bash
undefined

Full platform skill (all 250+ apps)

全平台技能(包含250+应用)

npx skills add inference-sh/skills@infsh-cli
npx skills add inference-sh/skills@infsh-cli

All image generation models

所有图像生成模型

npx skills add inference-sh/skills@ai-image-generation
npx skills add inference-sh/skills@ai-image-generation

FLUX models

FLUX模型

npx skills add inference-sh/skills@flux-image
npx skills add inference-sh/skills@flux-image

Pruna P-Image (fast & economical)

Pruna P-Image(快速且经济)

npx skills add inference-sh/skills@p-image

Browse all image apps: `belt app list --category image`
npx skills add inference-sh/skills@p-image

浏览所有图像应用:`belt app list --category image`

Documentation

文档