gpt-image-v2

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GPT Image v2

GPT Image v2

OpenAI's GPT Image v2 on the EachLabs Predictions API. GPT Image v2 delivers higher-fidelity images than v1.5 with stronger prompt understanding, improved compositional consistency, physically accurate lighting, and enhanced fine-detail rendering — including reliable in-image text.
Two model slugs:
SlugCategoryUse
gpt-image-v2-text-to-image
Text to ImageGenerate new images from a prompt
gpt-image-v2-edit
Image to ImageEdit an existing image with natural-language instructions
基于EachLabs Predictions API的OpenAI GPT Image v2。相较于v1.5版本,GPT Image v2能生成更高保真的图片,具备更强的提示词理解能力、更优的构图一致性、符合物理规律的光影效果,以及更出色的精细细节渲染——包括可靠的图内文本渲染。
两种模型标识:
标识类别使用场景
gpt-image-v2-text-to-image
文本转图片根据提示词生成新图片
gpt-image-v2-edit
图片转图片通过自然语言指令编辑现有图片

When to use

使用场景

  • User asks for "GPT Image", "OpenAI image", "gpt-image-2", or the image model behind ChatGPT.
  • High-fidelity photorealism with accurate in-image text (posters, infographics, packaging, signage).
  • Brand-consistent product photography with legible labels and logos.
  • Instruction-following edits that must preserve the subject and layout of a reference image.
For a wider model comparison (Flux, Seedream, Imagen, etc.) see
eachlabs-image-generation
. For other edit models see
eachlabs-image-edit
.
  • 用户要求使用“GPT Image”、“OpenAI image”、“gpt-image-2”或ChatGPT背后的图片模型时。
  • 需要具备精准图内文本的高保真照片级真实感场景(海报、信息图、包装、标识牌)。
  • 品牌风格统一且标签、Logo清晰可辨的产品摄影。
  • 需遵循指令编辑且必须保留参考图主体与布局的场景。
如需对比更多模型(Flux、Seedream、Imagen等),请查看
eachlabs-image-generation
。其他编辑模型请查看
eachlabs-image-edit

Authentication

身份验证

Header: X-API-Key: <your-api-key>
Set the
EACHLABS_API_KEY
environment variable. Get your key at eachlabs.ai/dashboard/api-keys.
Header: X-API-Key: <your-api-key>
设置
EACHLABS_API_KEY
环境变量。可前往eachlabs.ai/dashboard/api-keys获取密钥。

Prediction Flow

预测流程

  1. (Recommended) Check schema
    GET https://api.eachlabs.ai/v1/model?slug=gpt-image-v2-text-to-image
    to see the current
    request_schema
    . Do the same for
    gpt-image-v2-edit
    .
  2. POST
    https://api.eachlabs.ai/v1/prediction
    with
    model
    ,
    version: "0.0.1"
    , and
    input
    .
  3. Poll
    GET https://api.eachlabs.ai/v1/prediction/{id}
    until
    status
    is
    "success"
    or
    "error"
    , or use a webhook.
  4. Extract the output URLs from
    output
    (array).
  1. (推荐)检查 schema — 调用
    GET https://api.eachlabs.ai/v1/model?slug=gpt-image-v2-text-to-image
    查看当前
    request_schema
    gpt-image-v2-edit
    模型也需执行相同操作。
  2. POST请求 — 向
    https://api.eachlabs.ai/v1/prediction
    发送请求,包含
    model
    version: "0.0.1"
    input
    参数。
  3. 轮询状态 — 调用
    GET https://api.eachlabs.ai/v1/prediction/{id}
    ,直到
    status
    变为
    "success"
    "error"
    ,也可使用webhook。
  4. 提取结果 — 从
    output
    (数组)中获取输出URL。

Quick Start — Text to Image

快速开始——文本转图片

bash
curl -X POST https://api.eachlabs.ai/v1/prediction \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -d '{
    "model": "gpt-image-v2-text-to-image",
    "version": "0.0.1",
    "input": {
      "prompt": "A minimalist poster reading \"BREW LAB\" in bold serif, steam rising from a ceramic mug, warm paper texture, editorial photography"
    }
  }'
Typical processing time: ~40 seconds.
bash
curl -X POST https://api.eachlabs.ai/v1/prediction \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -d '{
    "model": "gpt-image-v2-text-to-image",
    "version": "0.0.1",
    "input": {
      "prompt": "A minimalist poster reading \"BREW LAB\" in bold serif, steam rising from a ceramic mug, warm paper texture, editorial photography"
    }
  }'
典型处理时间:~40秒

Quick Start — Edit

快速开始——图片编辑

bash
curl -X POST https://api.eachlabs.ai/v1/prediction \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -d '{
    "model": "gpt-image-v2-edit",
    "version": "0.0.1",
    "input": {
      "prompt": "Replace the background with a sunlit loft interior while keeping the product label and angle identical",
      "image_url": "https://your-cdn.example.com/product.jpg"
    }
  }'
Typical processing time: ~100 seconds. Reference images are always processed at high fidelity, so input image tokens (and cost) are higher than other GPT Image models.
bash
curl -X POST https://api.eachlabs.ai/v1/prediction \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $EACHLABS_API_KEY" \
  -d '{
    "model": "gpt-image-v2-edit",
    "version": "0.0.1",
    "input": {
      "prompt": "Replace the background with a sunlit loft interior while keeping the product label and angle identical",
      "image_url": "https://your-cdn.example.com/product.jpg"
    }
  }'
典型处理时间:~100秒。参考图始终以高保真处理,因此输入图片的令牌数(及成本)高于其他GPT Image模型。除非需要高细节,否则建议上传前将参考图长边缩小至1024px。

Polling

轮询状态

bash
curl https://api.eachlabs.ai/v1/prediction/{PREDICTION_ID} \
  -H "X-API-Key: $EACHLABS_API_KEY"
StatusMeaning
processing
Still running — poll again
success
Done — read
output
(array of URLs)
error
Failed — read
message
/
details
bash
curl https://api.eachlabs.ai/v1/prediction/{PREDICTION_ID} \
  -H "X-API-Key: $EACHLABS_API_KEY"
状态含义
processing
处理中——请再次轮询
success
处理完成——读取
output
(URL数组)
error
处理失败——读取
message
/
details

Webhook (alternative to polling)

Webhook(轮询替代方案)

Pass
"webhook_url": "https://your.host/path"
in the create body. EachLabs POSTs:
json
{
  "exec_id": "prediction-uuid",
  "status": "succeeded",
  "output": "https://...",
  "error": ""
}
status
is
"succeeded"
or
"failed"
. Return 2xx within 30 seconds.
在创建请求的参数中传入
"webhook_url": "https://your.host/path"
。EachLabs会发送POST请求:
json
{
  "exec_id": "prediction-uuid",
  "status": "succeeded",
  "output": "https://...",
  "error": ""
}
status
"succeeded"
"failed"
。需在30秒内返回2xx状态码。

Pricing

定价

Both models use dynamic token-based pricing:
Token typeRate
Text input$5 / 1M tokens
Image input$10 / 1M tokens
Text output$40 / 1M tokens
Image output$30 / 1M tokens
If the token breakdown is unavailable, EachLabs falls back to a "medium 1024×1024 equivalent" rate.
gpt-image-v2-edit
always processes reference images at high fidelity, so image-input tokens (and cost) run noticeably higher than with
gpt-image-v1-5-edit
or Nano Banana. Prefer downscaling references to 1024px on the long edge before upload unless you need high detail.
两种模型均采用基于令牌的动态定价
令牌类型费率
文本输入$5 / 1M令牌
图片输入$10 / 1M令牌
文本输出$40 / 1M令牌
图片输出$30 / 1M令牌
若无法获取令牌明细,EachLabs将采用“中等1024×1024等效”费率。
gpt-image-v2-edit
始终以高保真处理参考图,因此图片输入的令牌数(及成本)明显高于
gpt-image-v1-5-edit
或Nano Banana。除非需要高细节,否则建议上传前将参考图长边缩小至1024px。

Prompt Tips

提示词技巧

  • In-image text: wrap the exact copy in double quotes (
    "BREW LAB"
    ) and specify typography ("bold serif", "sans-serif headline"). v2 renders dense paragraphs and multilingual layouts reliably.
  • Composition: describe subject, framing, lens, and lighting separately. v2 respects compositional directives better than v1.5.
  • Edits: be specific about what must stay unchanged ("keep the label, angle, and lighting identical; only replace the background").
  • Photorealism: add concrete physical cues ("raking 45° sunlight, soft falloff, subtle skin SSS") rather than generic adjectives.
  • 图内文本:将精确文本用双引号包裹(
    "BREW LAB"
    )并指定字体样式("粗衬线体"、"无衬线标题字体")。v2版本可可靠渲染密集段落和多语言布局。
  • 构图:分别描述主体、取景、镜头和光影。v2版本比v1.5更能遵循构图指令。
  • 编辑操作:明确说明必须保留的内容("保留标签、角度和光影不变;仅替换背景")。
  • 照片级真实感:添加具体的物理细节("45°斜射阳光、柔和渐变、微妙的皮肤次表面散射"),而非通用形容词。

Rate Limits & Limits

速率限制与约束

LimitValue
Create requests100 / minute per key
Concurrent predictions10 per key
File inputsPublicly reachable HTTPS URLs only — no data-URIs, no localhost
限制项数值
创建请求速率每个密钥每分钟100次
并发预测数每个密钥10个
文件输入仅支持可公开访问的HTTPS URL — 不支持data-URIs或localhost地址

Errors

错误处理

Error body:
{ "status": "error", "message": "...", "details": "..." }
CodeMeaning
400Invalid input
401Missing / invalid
X-API-Key
404Unknown model or prediction id
429Rate limited — back off
5xxRetry with exponential backoff
错误响应体:
{ "status": "error", "message": "...", "details": "..." }
状态码含义
400输入无效
401缺失/无效的
X-API-Key
404未知模型或预测ID
429超出速率限制——请稍后重试
5xx指数退避后重试

Security Constraints

安全约束

  • No arbitrary URL loading:
    image_url
    must point to your own HTTPS-reachable storage (S3, GCS, CDN). Do not forward user-pasted URLs without validation.
  • No third-party API tokens: never forward OpenAI / Anthropic / HF tokens through
    input
    — authentication is exclusively via the EachLabs API key.
  • Validate before calling: always resolve the live
    request_schema
    via
    GET /v1/model?slug=<slug>
    before constructing
    input
    . The schema is the source of truth.
  • 禁止任意URL加载
    image_url
    必须指向您自己的HTTPS可访问存储(S3、GCS、CDN)。未经验证,请勿转发用户粘贴的URL。
  • 禁止第三方API令牌:切勿通过
    input
    转发OpenAI/Anthropic/HF令牌——身份验证仅通过EachLabs API密钥完成。
  • 调用前验证:构建
    input
    前,请始终通过
    GET /v1/model?slug=<slug>
    获取最新的
    request_schema
    。schema为权威依据。

Parameter Reference

参数参考

See references/MODELS.md for the full per-slug parameter table.
完整的分标识参数表请查看references/MODELS.md