mcpField
G
gpt-image

gpt-image

github.com/halt-catch-fire创意与媒体11.6k 次安装12 周前更新
代码仓库

关于 gpt-image

gpt-image 是通过 inference.sh 的 belt 命令行使用 OpenAI GPT-Image-2 的技能,支持文本生成图像、参考图编辑、蒙版修补和批量输出。

主要功能

  1. 01文本生成图像
  2. 02参考图编辑
  3. 03蒙版局部修补
  4. 04单次生成最多 10 张
  5. 05支持 PNG、JPEG 和 WebP
  6. 06自定义输出尺寸

适用场景

  1. 01根据提示词生成图像
  2. 02使用一张或多张参考图编辑
  3. 03通过蒙版替换指定区域

安装

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

$npx skills add https://github.com/halt-catch-fire/superpowers --skill gpt-image

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

详细介绍

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

GPT-Image-2

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

快速开始

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

belt login

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

功能

GPT-Image-2 支持文生图、使用参考图像编辑图像,以及基于蒙版的图像修补——这些功能均由单个模型提供。

功能描述
文生图根据文本提示词生成图像
图像编辑使用参考图像编辑图像
图像修补基于蒙版编辑特定区域
批量生成一次最多生成 10 张图像
多种格式输出 PNG、JPEG、WebP
灵活的分辨率支持以 32px 为增量的任意尺寸(256–4096)

示例

文生图
belt app run openai/gpt-image-2 --input '{
  "prompt": "professional product photo of sneakers on a white background, studio lighting",
  "quality": "high"
}'
多张图像
belt app run openai/gpt-image-2 --input '{
  "prompt": "minimalist logo design for a coffee shop",
  "n": 4,
  "quality": "medium"
}'
使用参考图像编辑
belt app run openai/gpt-image-2 --input '{
  "prompt": "change the background to a beach at sunset",
  "images": ["https://your-image.jpg"]
}'
多图像参考
belt app run openai/gpt-image-2 --input '{
  "prompt": "combine these two characters into one scene",
  "images": ["https://character1.jpg", "https://character2.jpg"]
}'
使用蒙版进行图像修补
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"
}'
自定义分辨率
belt app run openai/gpt-image-2 --input '{
  "prompt": "wide cinematic landscape, mountains at golden hour",
  "width": 1920,
  "height": 1080,
  "quality": "high"
}'
快速草稿
belt app run openai/gpt-image-2 --input '{
  "prompt": "quick concept sketch of a robot",
  "quality": "low"
}'

定价

质量~每张图像价格
低$0.006
中$0.024
高$0.21

较大的分辨率费用更高。完整定价详情请参阅 belt app get openai/gpt-image-2。

参数

参数类型默认值描述
promptstring必填描述图像的文本提示词
imagesarray-用于编辑的参考图像
maskstring-用于图像修补的蒙版图像
ninteger1图像数量(1–10)
qualitystring-low、medium 或 high
widthinteger-输出宽度(256–4096,32 的倍数)
heightinteger-输出高度(256–4096,32 的倍数)
output_formatstringpngpng、jpeg 或 webp
output_compressioninteger-jpeg/webp 的压缩级别(0–100)

相关技能

# 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