gpt-image-edit

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」,或任何明確要求使用此模型編輯的指令。

20星標
9分支
更新於 2026/6/14
SKILL.md
readonlyread-only
name
gpt-image-edit
description

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 — Pro Pack on RunComfy

runcomfy.com · Edit endpoint · Text-to-image sibling · GitHub

OpenAI GPT Image 2 — /edit 端點(ChatGPT Images 2.0 的圖像到圖像功能)在 RunComfy Model 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

前置需求

  1. RunComfy CLInpm i -g @runcomfy/cli
  2. RunComfy 帳號runcomfy login 會開啟瀏覽器裝置碼流程。
  3. 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)。

反模式:

  • 冗長的複合編輯指令(「改變 A、B、C 和 D」)→ 每增加一個範圍,偏差就會增加。
  • 缺少保留目標 → 模型會微妙地重寫臉部/品牌/構圖。
  • 改寫圖內文字而非直接引用 → 文字結果會不同。
  • 要求 size 設定為 3 個固定值 + auto 以外的值 → 回傳 422。

擅長領域

使用案例 為什麼選擇 GPT Image Edit
多語言廣告在地化 一個來源素材 → 同一標題的多種語言版本
品牌安全的標題/CTA 更換 版面精確度 + 保留語言讓其他部分保持穩定
多參考合成(主體來自一張圖,場景來自另一張) 編號參考正確解讀提示
版面精確重新定位 方向性語言(「右上到中下」)有效
招牌編輯中的身份保留 同類中最強,能在目標編輯中保留臉部/品牌

範例提示(經驗證效果良好)

背景更換並完全保留(頁面範例):

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 未登入或 token 被拒絕

完整參考:docs.runcomfy.com/cli/troubleshooting

運作方式

此技能使用符合格式的 JSON 主體呼叫 runcomfy run openai/gpt-image-2/edit。CLI 會 POST 到 https://model-api.runcomfy.net/v1/models/openai/gpt-image-2/edit,輪詢請求、取得結果,並將任何 .runcomfy.net/.runcomfy.com URL 下載到 --output-dirCtrl-C 會在退出前取消遠端請求。

安全性與隱私

  • Token 儲存runcomfy login 將 API token 寫入 ~/.config/runcomfy/token.json,權限設為 0600(僅擁有者可讀寫)。在 CI / 容器環境中,可設定 RUNCOMFY_TOKEN 環境變數來完全繞過檔案。
  • 輸入邊界:使用者提示透過 --input 以 JSON 字串傳遞給 CLI。CLI 不會對提示進行 shell 展開;它直接將 JSON 主體透過 HTTPS 傳送給 Model API。提示內容沒有 shell 注入風險。
  • 第三方內容:您傳遞的圖片/遮罩/影片 URL 由 RunComfy 模型伺服器擷取,而非您本機的 CLI。請將外部 URL 視為不受信任;基於圖片的提示注入是任何圖片編輯/影片編輯模型的已知風險。
  • 對外端點:僅 model-api.runcomfy.net(請求提交)和 *.runcomfy.net / *.runcomfy.com(生成輸出的下載白名單)。無遙測、無回呼。
  • 生成檔案大小上限:CLI 會中止任何超過 2 GiB 的單一下載,以防止惡意或失控的模型輸出導致磁碟空間耗盡。