gpt-image-v2
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGPT 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:
| Slug | Category | Use |
|---|---|---|
| Text to Image | Generate new images from a prompt |
| Image to Image | Edit an existing image with natural-language instructions |
基于EachLabs Predictions API的OpenAI GPT Image v2。相较于v1.5版本,GPT Image v2能生成更高保真的图片,具备更强的提示词理解能力、更优的构图一致性、符合物理规律的光影效果,以及更出色的精细细节渲染——包括可靠的图内文本渲染。
两种模型标识:
| 标识 | 类别 | 使用场景 |
|---|---|---|
| 文本转图片 | 根据提示词生成新图片 |
| 图片转图片 | 通过自然语言指令编辑现有图片 |
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 . For other edit models see .
eachlabs-image-generationeachlabs-image-edit- 用户要求使用“GPT Image”、“OpenAI image”、“gpt-image-2”或ChatGPT背后的图片模型时。
- 需要具备精准图内文本的高保真照片级真实感场景(海报、信息图、包装、标识牌)。
- 品牌风格统一且标签、Logo清晰可辨的产品摄影。
- 需遵循指令编辑且必须保留参考图主体与布局的场景。
如需对比更多模型(Flux、Seedream、Imagen等),请查看。其他编辑模型请查看。
eachlabs-image-generationeachlabs-image-editAuthentication
身份验证
Header: X-API-Key: <your-api-key>Set the environment variable. Get your key at eachlabs.ai/dashboard/api-keys.
EACHLABS_API_KEYHeader: X-API-Key: <your-api-key>设置环境变量。可前往eachlabs.ai/dashboard/api-keys获取密钥。
EACHLABS_API_KEYPrediction Flow
预测流程
- (Recommended) Check schema — to see the current
GET https://api.eachlabs.ai/v1/model?slug=gpt-image-v2-text-to-image. Do the same forrequest_schema.gpt-image-v2-edit - POST with
https://api.eachlabs.ai/v1/prediction,model, andversion: "0.0.1".input - Poll until
GET https://api.eachlabs.ai/v1/prediction/{id}isstatusor"success", or use a webhook."error" - Extract the output URLs from (array).
output
- (推荐)检查 schema — 调用查看当前
GET https://api.eachlabs.ai/v1/model?slug=gpt-image-v2-text-to-image。request_schema模型也需执行相同操作。gpt-image-v2-edit - POST请求 — 向发送请求,包含
https://api.eachlabs.ai/v1/prediction、model和version: "0.0.1"参数。input - 轮询状态 — 调用,直到
GET https://api.eachlabs.ai/v1/prediction/{id}变为status或"success",也可使用webhook。"error" - 提取结果 — 从(数组)中获取输出URL。
output
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"| Status | Meaning |
|---|---|
| Still running — poll again |
| Done — read |
| Failed — read |
bash
curl https://api.eachlabs.ai/v1/prediction/{PREDICTION_ID} \
-H "X-API-Key: $EACHLABS_API_KEY"| 状态 | 含义 |
|---|---|
| 处理中——请再次轮询 |
| 处理完成——读取 |
| 处理失败——读取 |
Webhook (alternative to polling)
Webhook(轮询替代方案)
Pass in the create body. EachLabs POSTs:
"webhook_url": "https://your.host/path"json
{
"exec_id": "prediction-uuid",
"status": "succeeded",
"output": "https://...",
"error": ""
}status"succeeded""failed"在创建请求的参数中传入。EachLabs会发送POST请求:
"webhook_url": "https://your.host/path"json
{
"exec_id": "prediction-uuid",
"status": "succeeded",
"output": "https://...",
"error": ""
}status"succeeded""failed"Pricing
定价
Both models use dynamic token-based pricing:
| Token type | Rate |
|---|---|
| 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.
always processes reference images at high fidelity, so image-input tokens (and cost) run noticeably higher than withgpt-image-v2-editor Nano Banana. Prefer downscaling references to 1024px on the long edge before upload unless you need high detail.gpt-image-v1-5-edit
两种模型均采用基于令牌的动态定价:
| 令牌类型 | 费率 |
|---|---|
| 文本输入 | $5 / 1M令牌 |
| 图片输入 | $10 / 1M令牌 |
| 文本输出 | $40 / 1M令牌 |
| 图片输出 | $30 / 1M令牌 |
若无法获取令牌明细,EachLabs将采用“中等1024×1024等效”费率。
始终以高保真处理参考图,因此图片输入的令牌数(及成本)明显高于gpt-image-v2-edit或Nano Banana。除非需要高细节,否则建议上传前将参考图长边缩小至1024px。gpt-image-v1-5-edit
Prompt Tips
提示词技巧
- In-image text: wrap the exact copy in double quotes () and specify typography ("bold serif", "sans-serif headline"). v2 renders dense paragraphs and multilingual layouts reliably.
"BREW LAB" - 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.
- 图内文本:将精确文本用双引号包裹()并指定字体样式("粗衬线体"、"无衬线标题字体")。v2版本可可靠渲染密集段落和多语言布局。
"BREW LAB" - 构图:分别描述主体、取景、镜头和光影。v2版本比v1.5更能遵循构图指令。
- 编辑操作:明确说明必须保留的内容("保留标签、角度和光影不变;仅替换背景")。
- 照片级真实感:添加具体的物理细节("45°斜射阳光、柔和渐变、微妙的皮肤次表面散射"),而非通用形容词。
Rate Limits & Limits
速率限制与约束
| Limit | Value |
|---|---|
| Create requests | 100 / minute per key |
| Concurrent predictions | 10 per key |
| File inputs | Publicly reachable HTTPS URLs only — no data-URIs, no localhost |
| 限制项 | 数值 |
|---|---|
| 创建请求速率 | 每个密钥每分钟100次 |
| 并发预测数 | 每个密钥10个 |
| 文件输入 | 仅支持可公开访问的HTTPS URL — 不支持data-URIs或localhost地址 |
Errors
错误处理
Error body:
{ "status": "error", "message": "...", "details": "..." }| Code | Meaning |
|---|---|
| 400 | Invalid input |
| 401 | Missing / invalid |
| 404 | Unknown model or prediction id |
| 429 | Rate limited — back off |
| 5xx | Retry with exponential backoff |
错误响应体:
{ "status": "error", "message": "...", "details": "..." }| 状态码 | 含义 |
|---|---|
| 400 | 输入无效 |
| 401 | 缺失/无效的 |
| 404 | 未知模型或预测ID |
| 429 | 超出速率限制——请稍后重试 |
| 5xx | 指数退避后重试 |
Security Constraints
安全约束
- No arbitrary URL loading: must point to your own HTTPS-reachable storage (S3, GCS, CDN). Do not forward user-pasted URLs without validation.
image_url - No third-party API tokens: never forward OpenAI / Anthropic / HF tokens through — authentication is exclusively via the EachLabs API key.
input - Validate before calling: always resolve the live via
request_schemabefore constructingGET /v1/model?slug=<slug>. The schema is the source of truth.input
- 禁止任意URL加载:必须指向您自己的HTTPS可访问存储(S3、GCS、CDN)。未经验证,请勿转发用户粘贴的URL。
image_url - 禁止第三方API令牌:切勿通过转发OpenAI/Anthropic/HF令牌——身份验证仅通过EachLabs API密钥完成。
input - 调用前验证:构建前,请始终通过
input获取最新的GET /v1/model?slug=<slug>。schema为权威依据。request_schema
Parameter Reference
参数参考
See references/MODELS.md for the full per-slug parameter table.
完整的分标识参数表请查看references/MODELS.md。