TL;DR
GPT-Image-2.5 是一組由兩個模型構成的影像 API 系列:Flare 著重於快速、日常的生成;Sunburst 著重於編輯精度與最終輸出保真度。透過 CometAPI,現有 OpenAI SDK 整合通常只需更換 base URL、API 金鑰與模型 ID 即可遷移。以 Flare 的中等品質起步,量測延遲與通過審核影像的成本,並將高要求的編輯或高階成品輸出路由至 Sunburst。
Key Takeaways
- Flare 是互動產品、快速迭代與高量生成的速度優先選擇。
- Sunburst 是在在地化編輯、參考保留與複雜最終合成上的精度優先選擇。
- 兩個模型皆支援文字與影像輸入、六檔品質模式,並可透過 Images API 進行影像生成或編輯。
- CometAPI 透過與 OpenAI 相容的 base URL 與 SDK 模式支援兩個模型 ID。
- 目前的 Arena 結果傾向 Sunburst 在生成與編輯上表現更佳,但兩個新模型仍標記為初步版本。
- 上線選型應基於延遲、接受率、編輯保真度、token 使用量,以及每張通過審核影像的有效成本。
2026 年 9 月 8 日,OpenAI 發佈 ChatGPT Images 2.5,並在 API 中推出兩個新的影像生成模型:GPT Image 2.5 Flare(快速、日常影像生成)與 GPT Image 2.5 Sunburst(針對影像品質與更嚴謹的編輯控制)。OpenAI 將 Flare 定位為大多數應用的預設選擇,而 Sunburst 則是其最強的影像生成與編輯模型。
兩個模型現已可透過 CometAPI 使用。實務上的優勢是開發者可沿用熟悉的 OpenAI SDK 介面,只需將 API 金鑰與 base URL 換成 CometAPI 憑證。CometAPI 的 OpenAI 相容 API 意味著既有的影像生成應用通常只需小幅整合改動,無須更換 SDK 或重寫請求架構。
本指南將示範如何透過 CometAPI 使用 cURL、Python 與 JavaScript 搭配 GPT-Image-2.5 進行影像生成與編輯,並說明如何為生產工作流程選擇合適的模型、品質層級、尺寸與輸出格式。
What Is the GPT-Image-2.5 API?
GPT-Image-2.5 是 OpenAI 目前的影像生成系列。它可接受文字與影像輸入並輸出影像。此系列包含兩個模型:GPT-Image-2.5 Flare,針對速度與日常使用最佳化;GPT-Image-2.5 Sunburst,針對極致能力與精準編輯最佳化。
How to GPT-Image-2.5 API Compared with GPT Image 2 API?
關鍵變化不僅是單一更快的替代品。GPT-Image-2.5 將工作負載分為兩種目的導向的選項。Flare 以較低延遲應對日常生成;Sunburst 針對最具挑戰的生成與編輯任務。兩者皆提供相同的廣域控制面,包括從 low 到 max 的品質層級、用於編輯的影像輸入,以及串流部分影像。
遷移時,先保留現有提示與請求結構,再依延遲與保真需求選擇模型。在導入生產前重新測試文字渲染、保留指示、遮罩、參考影像順序、輸出尺寸與成本。
Why Use GPT-Image-2.5 Through CometAPI?
當團隊已使用其閘道時,CometAPI 提供與 OpenAI 相容的存取層,可減少整合工作。實務好處包括集中金鑰管理、熟悉的請求格式、用量可視化,以及能以同一個 base URL 路由影像生成與編輯。
| Item | Value |
|---|---|
| Base URL | https://api.cometapi.com/v1 |
| Generation route | POST /images/generations |
| Editing route | POST /images/edits |
| Authentication | Authorization: Bearer $COMETAPI_KEY |
供應商價格與模型可用性可能變動。上線前請在 CometAPI 控制台確認模型識別碼、端點行為與當前計費。
How to Use GPT-Image-2.5 API in CometAPI
Step 1: Get a CometAPI API Key
建立或登入 CometAPI 帳號,並在 CometAPI API token 主控台 產生權杖。
請將金鑰儲存在環境變數中,而非硬編碼至應用程式原始碼:
| export COMETAPI_KEY="your-cometapi-key" |
|---|
在 Windows PowerShell:
| $env:COMETAPI_KEY="your-cometapi-key" |
|---|
請勿在瀏覽器端 JavaScript、公開儲存庫、螢幕截圖或客戶端應用程式中暴露 API 金鑰。生產環境建議使用伺服器端環境變數或秘密管理服務更為安全。
Step 2: Generate Your First Image with cURL
對多數應用而言,先從 Flare 開始。最小生成請求如下:
curl "https://api.cometapi.com/v1/images/generations" \-H "Authorization: Bearer $COMETAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2.5-flare", "prompt": "Premium product photograph of a matte black wireless speaker on a light concrete pedestal, soft window light, realistic material texture, clean editorial composition, no text", "size": "1536x1024", "quality": "medium", "output_format": "png" }' |
|---|
CometAPI 的關鍵差異在於端點與 API 金鑰。GPT Image 2.5 Flare API in CometAPI 使用 api.cometapi.com/v1/images/generations 端點與 Bearer 驗證。
GPT Image 模型通常透過 data[].b64_json 回傳生成影像內容,而非要求您的應用程式下載永久影像 URL。
簡化的回應如下:
| { "data": [ { "b64_json": "<base64-image-data>" } ], "usage": { "input_tokens": 32, "output_tokens": 1372, "total_tokens": 1404 } } |
|---|
您的應用程式應解碼該 Base64 欄位並儲存回傳位元組,而非直接儲存 Base64 字串作為最終資產。
Step 3: Generate an Image with Python
| import base64 import os import requests response = requests.post( "https://api.cometapi.com/v1/images/generations",
 headers={"Authorization": f"Bearer {os.environ['COMETAPI_KEY']}"}, json={ "model": "gpt-image-2.5-flare", "prompt": ( "A clean isometric illustration of a solar-powered research lab, " "white background, precise geometry, no labels or watermarks" ), "size": "1536x1024", "quality": "high", "output_format": "png", }, timeout=180, ) response.raise_for_status() payload = response.json() image_b64 = payload["data"][0]["b64_json"] with open("research-lab.png", "wb") as file: file.write(base64.b64decode(image_b64)) |
|---|
這是 CometAPI 對既有 OpenAI-SDK 專案的一大實務優勢:官方範例沿用相同的 OpenAI 客戶端,只需變更 base_url、金鑰與模型 ID,而無需替換應用層的 SDK。
Step 4: Use Multiple Reference Images with the Responses API
在撰寫提示前,先為每張影像指派穩定角色。常用的順序是:主體優先、風格其次,再來是背景或版面參考。請在提示中明確命名這些角色,避免模型自行推論應複製哪些屬性。
import base64
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["COMETAPI_KEY"],
base_url="https://api.cometapi.com/v1",
)
response = client.responses.create(
model="gpt-6-astra",
input=[{
"role": "user",
"content": [
{"type": "input_text", "text": (
"Create a campaign image. Use image 1 only for the product "
"shape and colors; image 2 only for lighting and visual style; "
"image 3 only for the background composition. Preserve the "
"product logo exactly and add no other text."
)},
{"type": "input_image", "image_url": "https://example.com/product.png"},
{"type": "input_image", "image_url": "https://example.com/style.png"},
{"type": "input_image", "image_url": "https://example.com/background.png"},
],
}],
tools=[{
"type": "image_generation",
"model": "gpt-image-2.5-sunburst",
}],
)
for item in response.output:
if item.type == "image_generation_call":
with open("campaign.png", "wb") as file:
file.write(base64.b64decode(item.result))
Responses API 於頂層使用受支援的主線模型,並在 image-generation tool 中選擇 GPT-Image-2.5。若閘道尚未暴露所選主線模型或工具綱要,請檢視當前 CometAPI 模型目錄並使用其文件化的等效項。
注意:可同時輸入多張參考影像,且每張影像可擔當不同角色;請在提示中清楚說明每張影像的用途。進行多影像編輯時,請留意輸入順序與語意對應。
How to Edit Existing Images
當需要在保留既有資產的前提下進行變更時,請使用編輯路由。先陳述必須固定不變的部分,再描述所需更動。
curl https://api.cometapi.com/v1/images/edits \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F "model=gpt-image-2.5-sunburst" \
-F "image[]=@product.png" \
-F "prompt=Preserve the product shape, label, and camera angle. Replace only the background with a warm studio gradient. Add no new text." \
-F "quality=high" \
-F "output_format=png"
輸入

輸出
Assign Roles to Multiple Input Images
請勿只依賴上傳順序。請明確說明「第 1 張影像是主體」、「第 2 張影像是風格參考」、「第 3 張影像是背景參考」。接著列出允許從每張影像轉移的屬性。這能降低錯誤複製錯誤參考之人臉、商標、文字或版面的風險。
Use a Mask for Localized Edits
遮罩會指引可編輯區域:透明像素表示允許變更,其餘區域應保留。遮罩應與來源影像尺寸與格式相同,包含 alpha 通道,並維持在 API 的檔案大小限制內。當輸入多張影像時,遮罩套用於第一張影像。
遮罩是引導而非逐像素的精確選取。請以保留語句強化,例如「僅變更透明區域;其餘像素、文字與幾何均需保留」。
Production Tips for GPT-Image-2.5 in CometAPI
模型規格未列出一般性的模型層級串流功能,但 Image API 與 Responses API 支援以 partial_images 進行影像生成串流預覽。這提供漸進式影像預覽,而非逐 token 的文字串流:Images API 接受partial_images 值為 0 到 3,並可在生成期間回傳相應數量的預覽。每張預覽影像會新增 100 個輸出 token。團隊可利用這些預覽打造生成進度 UI;不需要預覽的應用則可沿用標準生成與編輯流程。
即使
partial_images: 3已設定,也無法保證一定會收到三張預覽;若最終影像生成速度足夠快,實際收到的預覽張數可能少於請求數量。
GPT-Image-2.5 API Parameters
GPT-Image-2.5 提供比僅選提示與模型更豐富的輸出控制。
| Parameter — OpenAI image guide | What it controls | Recommended starting point |
|---|---|---|
| quality | 計算/細節層級 | 開發期建議用 medium |
| size | 影像解析度/長寬比 | 1024×1024 或 1536×1024 |
| output_format | PNG、JPEG、WebP | 保真用 PNG;投遞用 WebP/JPEG |
| background | 不透明或透明輸出 | 僅在需要時使用透明 |
| output_compression | JPEG/WebP 壓縮 | 針對網站投遞調整 |
| n | 回傳影像數量 | 先從 1 開始 |
| prompt | 視覺需求 | 將版面與限制寫清楚 |
Image API vs Responses API
| Criterion | Image API | Responses API |
|---|---|---|
| Best for | 直接的一次性生成與編輯 | 具對話式、多步驟或代理流程的影像工作流 |
| Model selection | 直接設定影像模型 | 使用主線模型加上 image-generation 工具 |
| Multiple references | 編輯時支援,取決於路由 | 天然適合多個 URL 或檔案 ID 輸入 |
| Iteration | 應用需重新提交上下文 | 為迭代回合與工具呼叫而設計 |
| Streaming previews | 支援部分影像預覽 | 支援部分影像預覽 |
| Choose when | 已知期望輸出並希望請求最短 | 模型需基於上下文、參考或前次結果進行推理 |
經驗法則:先以 Image API 起步。當工作流程需要對話狀態、多個語意參考,或在影像生成周邊調用其他工具時再轉向 Responses API。
Choosing quality
支援的品質階梯為:
| auto low medium high xhigh max |
|---|
auto 允許模型自行決定;然而在開發期,明確指定 medium 有助於讓 A/B 測試更可控。
實用的佈署模式:
| low / medium → drafts, previews, high-volume experimentation high → approved production assets xhigh / max → demanding final renders where the quality gain is worth the cost |
|---|
請勿因為可用就一律選 max。更多影像輸出 token 會增加成本,而薄弱的提示並不會因提升品質層級而自動變好。
Choosing image size
常見預設為:
| 1024x1024 1536x1024 1024x1536 |
|---|
2.5 模型亦支援任意有效尺寸,適合橫幅、產品頁、行動端創意與其他非正方形資產。OpenAI 目前規格允許在其像素總數與長寬比限制內,單邊最長至 3840 像素。OpenAI 影像提示指南
Creating transparent images
使用:
| { "background": "transparent", "output_format": "png" } |
|---|
或 WebP。透明輸出需支援 alpha 透明度的格式,因此 JPEG 不適用。透明背景需求
這對產品拋像、UI 資產、圖示、貼紙與合成管線特別實用。
How to Prompt GPT-Image-2.5
可靠的生產提示應將創意目標與限制分開撰寫。先寫正向指令,再列出保留與負向限制。
Define Composition
指定主體、鏡頭角度、取景、景深、背景與重要物件的相對位置。範例:「Three-quarter product view, centered, generous negative space on the right, eye-level camera, 50 mm lens look.」
Describe Lighting and Materials
說明光源方向、柔和度、對比、色溫與材質反應。範例:「Large softbox from the upper left, subtle rim light, realistic brushed aluminum, controlled reflections.」
Control Exact Text
將必須的文字置於引號內,並指定其位置、層級、大小寫與字體。要求不得新增其他文字。範例:「Place the exact headline ‘BUILD WITH CLARITY’ at the top center in bold uppercase sans serif. Preserve spelling exactly. Add no other words, letters, labels, or watermarks.」
State What Must Be Preserved
針對編輯,列出不可變更的要素:身份、姿勢、產品幾何、商標、標籤文字、比例、鏡頭角度或背景。請在提出修改前先陳述這些限制。
Add Negative Constraints
以直白語句列出常見失誤:例如「No extra fingers, no duplicated products, no warped logo, no misspelled text, no border, no watermark。」當負向限制針對特定風險而非泛泛的品質詞彙時,效果最佳。
How Much Does GPT-Image-2.5 Cost?
Official OpenAI API Costs
在驗證時點,Flare 與 Sunburst 的 token 價格相同:每百萬文字輸入 token 為 5 美元、快取文字輸入為 1.25 美元;每百萬影像輸入 token 為 8 美元、快取影像輸入為 2 美元;每百萬影像輸出 token 為 30 美元。最終成本取決於實際 token 使用量,而非僅請求數量。
CometAPI Pricing and Ways to Reduce Cost
CometAPI 目前在其模型目錄中標示對 GPT-Image-2.5 Flare 提供 20% 折扣。請以儀表板與發票為準,因為閘道定價可能變動。欲降低花費,可在日常任務使用 Flare、從 medium 或 high 起步、將 xhigh 或 max 保留給核准用例、在支援處重用快取輸入、避免不必要變體,且將 partial_images 設為 0,除非預覽能提升使用者體驗。
Other Cost Factors and a Worked Example
成本受提示長度、參考影像數量與解析度、輸出尺寸、品質、最終輸出 token、請求變體、部分預覽、重試與退件影響。請同時追蹤每次請求的花費與每張通過審核影像的花費。
通過審核影像成本 = 生成總花費 ÷ 通過審核的輸出數。
舉例:10 次嘗試每次 $0.18,共 $1.80。若其中 6 張通過審核,通過審核影像成本為 $0.30,而非 $0.18。若更好的提示將嘗試數降至 8 次且仍有 6 張通過,通過審核影像成本降至 $0.24。
Flare vs. Sunburst: Which Model Should You Use?
模型選擇應由工作負載驅動,而非將 Sunburst 視為 Flare 的自動替換。
| Decision | GPT Image 2.5 Flare | GPT Image 2.5 Sunburst |
|---|---|---|
| Interactive application | 推薦 | 謹慎選用 |
| Rapid prompt iteration | 推薦 | 通常不需要 |
| High-volume creative generation | 推薦 | 取決於接受率 |
| Product/reference editing | 良好 | 推薦 |
| Complex final composition | 良好 | 推薦 |
| Maximum editing control | 良好 | 推薦 |
| Latency-sensitive UI | 推薦 | 較不適合 |
| Premium final asset | 先測試 | 當品質提升可量化時推薦 |
對許多產品而言,最佳架構並非「永遠選一個」。將大多數請求路由至 Flare,再把高要求的修訂或高價值最終輸出交給 Sunburst。
How Do You Migrate from GPT Image 2 to GPT-Image-2.5?
若您已透過 CometAPI 使用 GPT Image 2,由於生成與編輯仍在 Images API 路由上,遷移相對簡單。
最簡單的變更是:
| # Before model="gpt-image-2" # After: speed-first model="gpt-image-2.5-flare" # After: precision-first model="gpt-image-2.5-sunburst" |
|---|
但請勿只停在更換 ID。請用固定的評估集重新檢視品質、輸出尺寸、延遲、主體保留、文字正確性、編輯侷限性,以及真實的 token 使用量。
OpenAI 特別建議在比較模型時,將提示、參考、尺寸與輸出格式保持不變,讓模型變更成為唯一變因。OpenAI 遷移指引
Production Tips for GPT-Image-2.5 in CometAPI
在生產服務中,請將 GPT-Image-2.5 周邊實作維持精簡:金鑰僅存伺服器端、將解碼後的影像儲存在自有儲存、記錄模型/品質/尺寸/延遲/用量、限制重試次數,並區分 400 錯誤與暫時性的 429 或 5xx 失敗。
CometAPI 已發佈專門指南,涵蓋佇列、受控併發、指數回退、耐久 ID、儲存、清單與批次成本追蹤。與其在此重複實作,當您從單一 API 呼叫轉向批量生產時,請參考 How to Automate Image Generation at Scale。
這個區別在將為 OpenAI 原生 API 撰寫的範例改用第三方 OpenAI 相容端點時尤其重要。
Common GPT-Image-2.5 API Errors
| Error | Likely cause | What to do |
|---|---|---|
| 401 Unauthorized | CometAPI 金鑰無效/缺失 | 驗證 COMETAPI_KEY 與 Bearer 標頭 |
| 400 Bad Request | 參數、尺寸、格式或模型 ID 無效 | 移除選填欄位並測試最小請求 |
| 429 Too Many Requests | 觸達併發或帳戶限制 | 退避並帶抖動重試 |
| Repeated 5xx | 臨時上游/API 問題 | 有限次數重試 |
| Image appears as Base64 text | 未解碼 b64_json | 以 Base64 解碼並儲存位元組 |
| Transparent output fails | 不相容的輸出格式 | 使用 PNG 或 WebP |
| Edit changes too much | 提示未明確約束需保留的部分 | 明確說明哪些內容不可變 |
| Costs rise unexpectedly | 較高品質/解析度或重試增加 | 記錄每次請求用量並計算通過審核影像成本 |
請勿自動重試所有失敗。格式錯誤的 400 請求通常仍會是格式錯誤;而對驗證失敗重試只會產生更多失敗流量。
Rate Limits and Concurrency
| Tier | TPM | IPM |
|---|---|---|
| Tier 1 | 100K | 5 |
| Tier 2 | 250K | 20 |
| Tier 3 | 800K | 50 |
| Tier 4 | 3M | 150 |
| Tier 5 | 8M | 250 |
Conclusion
GPT-Image-2.5 提供比單純世代升級更有用的模型分工:Flare 針對快速的日常影像工作負載最佳化,而 Sunburst 為高要求的生成與編輯工作流程提供更高精度的選項。
透過 CometAPI,兩者皆能以最小整合成本置入既有的 OpenAI 相容應用。從 /v1/images/generations 端點、Flare、受控的品質設定與一組具代表性的提示集開始。當產品需要更強的參考保留或更精確的視覺更動時,再加入 /v1/images/edits 與 Sunburst。
關鍵最佳化不僅是選擇最強設定,而是量測您的實際工作負載之延遲、token 使用量、接受率、編輯準確性,以及每張通過審核影像的有效成本。這些指標決定了 Flare 或 Sunburst 哪個更適合生產環境。
FAQ
Is GPT-Image-2.5 available on CometAPI?
是的。GPT Image 2.5 Flare 與 GPT Image 2.5 Sunburst 皆可透過 CometAPI 使用。
Do I need a separate OpenAI API key?
不需要。透過 CometAPI 呼叫模型時,會使用您的 CometAPI 金鑰對 CometAPI 端點進行驗證。
Should I use Flare or Sunburst?
大多數生成工作負載先用 Flare。當編輯精度、複雜合成或參考影像細節保留能明顯提升輸出通過率時,使用 Sunburst。這與 OpenAI 對兩個模型的定位一致。
Can GPT-Image-2.5 edit existing images?
可以。當前模型規格支援影像輸入與影像編輯,且 CometAPI 已暴露該系列的影像編輯能力。GPT Image 2.5 Flare API in CometAPI
Does GPT-Image-2.5 support transparent images?
可以。將 background 設為 transparent,並使用 PNG 或 WebP 作為輸出格式。OpenAI 影像提示指南
Can I use the OpenAI Python SDK with CometAPI?
可以。CometAPI 目前的範例以標準 OpenAI 客戶端實例化,設定 base_url="https://api.cometapi.com/v1" 並使用 CometAPI 金鑰。CometAPI SDK 範例
