
gpt-image-edit
使用RunComfy上的OpenAI GPT Image 2(ChatGPT Images 2.0的`/edit`端点)编辑图像——该技能捆绑了模型文档化的提示模式,因此比针对同一模型的简单提示获得更清晰的输出。文档介绍了GPT Image Edit的优势(保留语言、多语言图像内文本编辑、最多10张图像的多参考、布局/排版精度)、输入模式,以及何时改用Nano Banana Edit / Flux Kontext / GPT Image 2 t2i。通过本地RunComfy CLI调用`runcomfy run openai/gpt-image-2/edit`。触发词包括“gpt image edit”、“gpt-image-edit”、“chatgpt image edit”、“edit with gpt image 2”,或任何明确要求使用此模型编辑的请求。
Edit images with OpenAI GPT Image 2 (the `/edit` endpoint of ChatGPT Images 2.0) on RunComfy — bundled with the model's documented prompting patterns so the skill gets sharper output than naive prompting against the same model. Documents GPT Image Edit's strengths (preservation language, multilingual in-image text editing, multi-reference up to 10 images, layout / typography precision), the schema, and when to route to Nano Banana Edit / Flux Kontext / GPT Image 2 t2i instead. Calls `runcomfy run openai/gpt-image-2/edit` through the local RunComfy CLI. Triggers on "gpt image edit", "gpt-image-edit", "chatgpt image edit", "edit with gpt image 2", or any explicit ask to edit with this model.
GPT Image Edit — RunComfy 专业包
runcomfy.com · 编辑端点 · 文生图兄弟技能 · GitHub
OpenAI GPT Image 2 — /edit 端点(ChatGPT Images 2.0 图到图)在 RunComfy 模型 API 上。在其类别中,在通过定向编辑保留身份和重写任何脚本(拉丁、假名、中日韩、西里尔、阿拉伯)中的嵌入文本方面最强。
npx skills add agentspace-so/runcomfy-skills --skill gpt-image-edit -g
何时选择此模型(与兄弟模型对比)
| 您想要 | 使用 |
|---|---|
| 编辑图像中的多语言/嵌入文本 | GPT Image Edit |
| 通过翻译标题变体保留身份 | GPT Image Edit |
| 布局精确的编辑(移动标题、交换 CTA 等) | GPT Image Edit |
| 最多 10 张参考图像 | GPT Image Edit |
| 批量处理最多 20 张图像且保持一致 | Nano Banana Edit |
| 单次精确局部编辑,源保真优先 | Flux Kontext |
| 从头生成(GPT Image 2) | 兄弟技能 gpt-image-2 |
| 批量 SKU 图库且身份稳定 | Nano Banana Edit |
前提条件
- RunComfy CLI —
npm i -g @runcomfy/cli - RunComfy 账户 —
runcomfy login打开浏览器设备码流程。 - CI / 容器 — 设置
RUNCOMFY_TOKEN=<token>代替runcomfy login。
端点 + 输入模式
openai/gpt-image-2/edit
| 字段 | 类型 | 必需 | 默认值 | 说明 |
|---|---|---|---|---|
prompt |
string | 是 | — | 编辑指令。以保留开头,以更改结尾。 |
images |
string[] | 是 | — | 最多 10 个可公开获取的 HTTPS URL。第一个是主要图像;其余是辅助图像。 |
size |
enum | 否 | auto |
auto(保留输入比例),1024_1024(1:1),1024_1536(2:3 竖屏),1536_1024(3:2 横屏)。 |
size=auto 保留输入比例——强烈推荐,除非编辑明确改变构图。
如何调用
单参考保留编辑:
runcomfy run openai/gpt-image-2/edit \
--input '{
"prompt": "Keep the person'\''s face, pose, and brand mark unchanged. Replace the background with a soft warm-grey studio sweep and a gentle floor shadow.",
"images": ["https://.../portrait.jpg"]
}' \
--output-dir <absolute/path>
多语言文本重写(保留除标题外的所有内容):
runcomfy run openai/gpt-image-2/edit \
--input '{
"prompt": "Keep the photograph, layout, and brand mark exactly as in the input. Replace only the in-image headline. The new headline reads \"今日のおすすめ\" in bold Japanese kana, same position and font weight as before.",
"images": ["https://.../poster-en.jpg"]
}' \
--output-dir <absolute/path>
多参考合成:
runcomfy run openai/gpt-image-2/edit \
--input '{
"prompt": "Compose subject from image 1 into the room from image 2. Match the lighting and color palette of image 2. Keep image 1 subject identity (face, pose, clothing) unchanged.",
"images": ["https://.../subject.jpg", "https://.../room.jpg"]
}' \
--output-dir <absolute/path>
提示技巧——实际有效的方法
以保留目标开头。 始终:"Keep [face / pose / clothing / brand / framing] unchanged." 然后说明更改。模型会尊重前面明确说明的内容。
多语言文本——引用字符,命名脚本。 "the headline reads \"コーヒー\" in bold Japanese kana","the label says \"АРОМА\" in Cyrillic, white on black","the right-margin caption reads \"تخفيض\" in Arabic right-to-left"。不要转述——直接引用。
空间编辑的方向性语言。 具体的空间范围有效:"move the headline from top-right to bottom-center","remove the leftmost object only","replace the watermark in the bottom-right corner"。
多参考编号。 传递多个 images 时,按编号引用:"subject from image 1, lighting from image 2, color palette from image 3"。模型能正确路由提示。
使用 size: "auto" 保留输入比例。 仅在编辑明确改变构图时覆盖(例如将 16:9 裁剪为 1:1)。
反模式:
- 长复合编辑指令("change A and B and C and D")→ 每增加一个范围,漂移增加。
- 缺少保留目标 → 模型会微妙地重写面部/品牌/构图。
- 转述图像内文本而不是直接引用 → 文本结果不同。
- 要求
size超出 3 个固定值 +auto→ 返回 422。
擅长领域
| 用例 | 为什么选择 GPT Image Edit |
|---|---|
| 多语言广告本地化 | 一个源素材 → 同一标题的多种语言变体 |
| 品牌安全的标题/CTA 替换 | 布局精度 + 保留语言保持其余部分稳定 |
| 多参考合成(主体来自一张,场景来自另一张) | 编号参考正确路由提示 |
| 布局精确的重新定位 | 方向性语言("top-right to bottom-center")得到尊重 |
| 标志编辑中的身份保留 | 在定向编辑中面部/品牌保留最强 |
示例提示(已验证可产生强结果)
完全保留的背景替换(页面示例):
Turn the background into a bright minimal white-to-soft-gray studio
sweep with gentle floor shadow; add a large headline in-image that
reads "OPEN STUDIO" in a bold clean sans-serif, high contrast, centered;
keep the main person or product, pose, and face identity unchanged
多语言变体:
Keep the photograph, layout, lighting, and brand mark exactly as in the
input. Replace only the in-image headline.
The new headline reads "コーヒー" in bold Japanese kana, same position
and font weight as before.
多参考合成:
Compose subject from image 1 into the kitchen from image 2.
Match the warm window light and color palette of image 2.
Keep subject identity (face, pose, clothing) from image 1 unchanged.
限制
size:3 个固定值 +auto— 其他值返回 422。images:最多 10 个 — 第一个是主要图像,其余是辅助提示。- 长复合提示会漂移 — 必要时分成多次传递。
- 对于跨多个 SKU 图像的批量一致性,Nano Banana Edit(最多 20 张)更好。
- 人像照片真实感 — Nano Banana Pro 更胜一筹。
退出码
| 代码 | 含义 |
|---|---|
| 0 | 成功 |
| 64 | CLI 参数错误 |
| 65 | 输入 JSON 错误 / 模式不匹配 |
| 69 | 上游 5xx |
| 75 | 可重试:超时 / 429 |
| 77 | 未登录或令牌被拒绝 |
完整参考:docs.runcomfy.com/cli/troubleshooting。
工作原理
该技能使用与模式匹配的 JSON 主体调用 runcomfy run openai/gpt-image-2/edit。CLI 向 https://model-api.runcomfy.net/v1/models/openai/gpt-image-2/edit 发送 POST 请求,轮询请求,获取结果,并将任何 .runcomfy.net/.runcomfy.com URL 下载到 --output-dir。Ctrl-C 在退出前取消远程请求。
安全与隐私
- 令牌存储:
runcomfy login将 API 令牌写入~/.config/runcomfy/token.json,权限为 0600(仅所有者读写)。在 CI/容器中设置RUNCOMFY_TOKEN环境变量以完全绕过文件。 - 输入边界:用户提示通过
--input作为 JSON 字符串传递给 CLI。CLI 不会对提示进行 shell 扩展;它通过 HTTPS 将 JSON 主体直接传输到模型 API。提示内容没有 shell 注入风险。 - 第三方内容:您传递的图像/蒙版/视频 URL 由 RunComfy 模型服务器获取,而不是由您机器上的 CLI 获取。将外部 URL 视为不受信任;图像提示注入是任何图像编辑/视频编辑模型的已知风险。
- 出站端点:仅
model-api.runcomfy.net(请求提交)和*.runcomfy.net/*.runcomfy.com(生成输出的下载白名单)。无遥测,无回调。 - 生成文件大小上限:CLI 会中止任何超过 2 GiB 的单个下载,以防止恶意或失控模型输出导致磁盘填满。





