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

2星標
1分支
更新於 2026/6/18
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-dir。按下 Ctrl-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 的單一下載,以防止惡意或失控的模型輸出導致磁碟空間耗盡。