mcpField
G
gpt-image

gpt-image

github.com/inference-sh创意与媒体78922.0k 次安装2 周前更新
代码仓库

关于 gpt-image

gpt-image 是通过 belt 命令行使用 OpenAI 的 GPT-Image 模型生成和编辑图像的技能。它将文本生成、参考图编辑和蒙版局部修补整合在一起,并支持批量输出和自定义尺寸。

主要功能

  1. 01根据文本生成图像
  2. 02使用参考图编辑
  3. 03修补蒙版区域
  4. 04单次生成最多 10 张
  5. 05导出 PNG、JPEG 或 WebP
  6. 06设置尺寸和透明背景

适用场景

  1. 01制作产品视觉图
  2. 02修改现有照片
  3. 03替换图像选定区域
  4. 04生成透明图标或贴纸

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/inference-sh/skills --skill gpt-image

安装后在 Claude Code 中输入/gpt-image确认已加载。

详细介绍

安装 belt CLI skill: npx skills add belt-sh/cli

GPT-Image

通过 inference.sh CLI 使用 OpenAI 的 GPT-Image-2.5 和 GPT-Image-2 生成和编辑图像。

模型

模型App ID适用场景
GPT-Image-2.5 Flareopenai/gpt-image-2-5-flare默认选择。质量高于 GPT-Image-2,延迟降低 50%
GPT-Image-2.5 Sunburstopenai/gpt-image-2-5-sunburst高级编辑:保留主体和构图,并在多轮编辑中提供更精准的控制
GPT-Image-2openai/gpt-image-2上一代

三者使用相同的输入架构。2.5 模型新增 xhigh 和 max 质量等级。

快速开始

需要 inference.sh CLI(belt)。安装说明

belt login

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

功能

每个 GPT-Image 应用都支持文生图、使用参考图像编辑,以及通过单个应用进行基于蒙版的局部重绘。

功能说明
文生图根据文本提示词生成图像
图像编辑使用参考图像编辑图像
局部重绘基于蒙版编辑指定区域
批量生成一次最多生成 10 张图像
多种格式输出 PNG、JPEG、WebP
透明背景输出带 Alpha 通道的 PNG/WebP,适用于贴纸、图标、产品抠图
灵活分辨率支持 16px 递增的任意尺寸(256–3840),宽高比最高可达 3:1

示例

文生图
belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "professional product photo of sneakers on a white background, studio lighting",
  "quality": "high"
}'
多张图像
belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "minimalist logo design for a coffee shop",
  "n": 4,
  "quality": "medium"
}'
使用参考图像编辑
belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "change the background to a beach at sunset",
  "images": ["https://your-image.jpg"]
}'
使用 Sunburst 精确编辑

Sunburst 专为仅更改你指定的内容并保留其他部分而设计。

belt app run openai/gpt-image-2-5-sunburst --input '{
  "prompt": "change the jacket to red leather, keep the person, pose and background unchanged",
  "images": ["https://your-photo.jpg"],
  "quality": "high"
}'
最高细节
belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "macro photo of a dragonfly wing, intricate veins, morning dew",
  "quality": "max"
}'
多图参考
belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "combine these two characters into one scene",
  "images": ["https://character1.jpg", "https://character2.jpg"]
}'
使用蒙版进行局部重绘
belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "replace with a red sports car",
  "images": ["https://street-scene.jpg"],
  "mask": "https://car-mask.png"
}'
透明背景

提示词应描述一个独立主体;如果描述场景或背景,模型就会绘制背景。需要使用 png(默认)或 webp 输出。

belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "a single red apple with a green leaf, isolated subject",
  "background": "transparent"
}'
自定义分辨率
belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "wide cinematic landscape, mountains at golden hour",
  "width": 1920,
  "height": 1080,
  "quality": "high"
}'
快速草稿
belt app run openai/gpt-image-2-5-flare --input '{
  "prompt": "quick concept sketch of a robot",
  "quality": "low"
}'

定价

每张 1024x1024 图像的大致价格。Flare 和 Sunburst 的价格相同。

质量GPT-Image-2.5GPT-Image-2
low$0.006$0.006
medium$0.013$0.053
high$0.053$0.21
xhigh$0.094–
max$0.21–

更高分辨率的费用更高。每张参考图像的编辑费用约增加 $0.008。完整定价详情请参阅 belt app get openai/gpt-image-2-5-flare。

参数

参数类型默认值说明
promptstring必填描述图像的文本提示词
imagesarray-用于编辑的参考图像
maskstring-用于局部重绘的蒙版图像
ninteger1图像数量(1–10)
qualitystringautolow、medium、high、xhigh、max(xhigh/max 仅适用于 2.5)
widthinteger1024输出宽度(256–3840,以 16 为增量,宽高比 ≤ 3:1)
heightinteger1024输出高度(256–3840,以 16 为增量,宽高比 ≤ 3:1)
output_formatstringpngpng、jpeg 或 webp
output_compressioninteger-jpeg/webp 的压缩级别(0–100)
backgroundstringautoauto、transparent 或 opaque(transparent 需要 png/webp)

相关技能

# Full platform skill (all apps)
npx skills add inference-sh/skills@infsh-cli

# All image generation models
npx skills add inference-sh/skills@ai-image-generation

# FLUX models
npx skills add inference-sh/skills@flux-image

# Pruna P-Image (fast & economical)
npx skills add inference-sh/skills@p-image

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

文档

评论

支持 Markdown