跳到正文
image 2.5
简体中文
开始创作

GPT Image 2.5 官方提示词使用手册2

官方指南里所有「改图」相关的方法都在这篇:八个图像编辑场景、跨轮次迭代与角色一致性,外加一段可运行的官方代码。每段都是官方原文提示词配两个档位的官方出图,可以直接照着改。

编辑的写法:改什么、保什么

生成类提示词只描述画面,编辑类提示词要同时描述画面和边界。官方把这件事拆成两个并行的清单:一个写「要改什么」,一个写「必须不动的是什么」。缺了后一个,模型就会顺手把你没提到的地方也重画一遍。

官方给的编辑入口是接口里的 client.images.edit,参考图通过 image 参数传入;需要蒙版的局部编辑另有对应做法。下面八个场景都建立在这一条写法之上。

  • 说清「只改 X」,并列出要保留的细节:身份、几何、版式、光线、标签。
  • 把排除项也写出来:不要多余文字、不要 logo、不要水印。
  • 局部精修要额外点名饱和度、对比度、箭头、机位和周围物体。
  • 每张输入图都要分配角色并编号——主体、风格、服装还是背景。
  • 一次只提一个改动,把上一轮输出当作下一轮输入,并重复要保留的细节。

场景一:翻译文字并保留版式

官方这个示例用的输入图就是前面那台咖啡机的信息图:要求把图里的文字换成西班牙语,其他方面一概不动。出图后要检查两件事——翻译是否正确,以及有没有残留的原文。

这类提示词的价值在于它只写了一句,却完整表达了「局部改动 + 全局冻结」的结构。

官方编辑参数:size="1024x1536",quality="high"。

官方提示词(原文)
Translate the text in the infographic to Spanish. Do not change any other aspect of the image.
咖啡机信息图被翻译为西班牙语后的结果,原版式保持,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。检查翻译与残留原文。
咖啡机信息图被翻译为西班牙语后的结果,原版式保持,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

场景二:迁移视觉风格

风格迁移的关键是给参考图一个明确的角色:这一张提供的是调色、质感还是媒介。官方示例把参考图的作用限定为「风格」,新主体单独描述,两者不要混在一句话里。

官方编辑参数:size="1024x1536",quality="medium"。

官方提示词(原文)
Use the same style from the input image and generate a man riding a motorcycle on a white background.
用作风格参考的像素游戏画面
输入图官方输入的风格参考图:像素风游戏画面。
用参考风格生成的像素风摩托车骑手,白底,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。
用参考风格生成的像素风摩托车骑手,白底,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

场景三:保持身份、更换服装

这是官方演示「冻结清单」最完整的一段:先声明只换服装,然后把不许变的项目逐条列出——脸、五官、肤色、体型、姿势、身份、神态、发型、比例,连背景、机位、取景和画质都要冻结,最后再排除配饰、文字、logo 和水印。

同一个结构也适用于产品:要保留的是产品的可识别外形、标签和材质,只允许一处发生变化。

官方编辑参数:size="1024x1536",quality="medium"。输入图:一张人物照片 + 三张服装参考图。

官方提示词(原文)
Edit the image to dress the woman using the provided clothing images. Do not change her face, facial features, skin tone, body shape, pose, or identity in any way. Preserve her exact likeness, expression, hairstyle, and proportions. Replace only the clothing, fitting the garments naturally to her existing pose and body geometry with realistic fabric behavior. Match lighting, shadows, and color temperature to the original photo so the outfit integrates photorealistically, without looking pasted on. Do not change the background, camera angle, framing, or image quality, and do not add accessories, text, logos, or watermarks.
用作身份参考的女性照片,拍摄于博物馆内
输入图 · 身份官方输入图:提供身份与姿势的人物照片。
用作服装参考的米色外套
输入图 · 服装官方输入图:米色外套。
用作服装参考的白色背心
输入图 · 服装官方输入图:白色背心。
用作服装参考的灰色靴子
输入图 · 服装官方输入图:灰色靴子。
同一人物换上指定服装后的合成结果,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位,检查脸与身份是否被改动。
同一人物换上指定服装后的合成结果,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

场景四:组合多张参考图

多图合成要交代三件事:把什么元素搬走、搬到哪张图的哪里、以及除此之外什么都不要改。官方示例把场景照作为第一张输入、带狗的照片作为第二张输入,提示词里直接用编号指向对应图片,并额外约束光线、构图和背景沿用第一张。

官方编辑参数:size="1024x1536",quality="medium"。

官方提示词(原文)
Place the dog from the second image into the setting of image 1, right next to the woman, use the same style of lighting, composition and background. Do not change anything else.
街景中的女性,多图合成的第一张输入图
输入图 1官方输入图 1:提供场景、光线与构图。
与狗合影的女性,多图合成的第二张输入图
输入图 2官方输入图 2:提供要被搬走的元素。
狗被放进街景中女性身旁的合成结果,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。
狗被放进街景中女性身旁的合成结果,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

场景五:透明产品抠图

抠图是唯一一个必须「提示词 + 参数」双管齐下的场景。官方要求提示词里既要主体居中、轮廓干净、没有光晕和描边、产品几何与标签可读性精确保持,又要明确排除实底、棋盘格、场景和阴影;同时参数侧设 background="transparent",输出用 PNG 或 WebP,并且不要对 PNG 使用 output_compression。

后续如果要继续编辑这张透明图,官方提醒必须重复「保持透明背景」这一条。

官方编辑参数:size="1024x1536",quality="medium",background="transparent",output_format="png"。

官方提示词(原文)
Extract the product from the input image and isolate it on a fully transparent background.
Output: centered product, crisp silhouette, no halos/fringing.
Preserve product geometry and label legibility exactly.
Add only light polishing. Do not add a solid backdrop, checkerboard, scenery, or shadow.
Do not restyle the product; remove the background and preserve clean alpha transparency.
原始洗发水产品照片
输入图官方输入图:原始产品照片。
从原始照片中抠出的洗发水,透明背景,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。
从原始照片中抠出的洗发水,透明背景,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

场景六:线稿转写实

线稿转渲染这类工作流,官方把它定位成「把粗略草图变成写实概念图,同时保留原本的意图」。做法是把提示词当规格来写:先要求保持精确的版式、比例和透视,再让模型自行选择与草图意图一致的写实材质和光线,最后加上「不要新增元素或文字」这条闸门,否则模型很可能按自己的理解重画构图。

官方编辑参数:size="1024x1536",quality="medium"。

官方提示词(原文)
Turn this drawing into a photorealistic image.
Preserve the exact layout, proportions, and perspective.
Choose realistic materials and lighting consistent with the sketch intent.
Do not add new elements or text.
河谷的线条草图
输入图官方输入图:河谷线稿。
从线稿渲染出的写实河谷,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。
从线稿渲染出的写实河谷,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

场景七:移除画面里的物体

移除物体是最短的一类编辑提示词:点名要移走的对象,然后冻结其余全部。官方示例只写了「把手里的花去掉,其他什么都不要改」,靠的就是后半句把人物、姿势、光线和构图全部锁住,让编辑停留在局部。

官方编辑参数:size="1024x1536",quality="medium"。

官方提示词(原文)
Remove the flower from man's hand. Do not change anything else.
手持花朵、戴蓝色帽子的男子
输入图官方输入图:待编辑的原始照片。
移除花朵之后的同一名男子,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。
移除花朵之后的同一名男子,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

场景八:把人物放进新场景

把一个人放进全新场景,要同时处理身份保持和场景可信度。官方示例用的输入图就是博物馆里的那位女性,提示词先要求画面像「真实拍到的照片」而不是电影海报,再交代她的位置、朝向、服装状态和情绪,最后点出地点、时间与自然光线,并明确避开电影感打光、戏剧化调色和风格化构图。

官方在这一节还有一条技术说明:迁移到 gpt-image-2 时要省略 input_fidelity 参数,因为图像输入始终按高保真处理。

官方编辑参数:size="1024x1536",quality="medium"。

官方提示词(原文)
Generate a highly realistic action scene where this person is running away from a large, realistic brown bear attacking a campsite. The image should look like a real photograph someone could have taken, not an overly enhanced or cinematic movie-poster image.
She is centered in the image but looking away from the camera, wearing outdoorsy camping attire, with dirt on her face and tears in her clothing. She is clearly afraid but focused on escaping, running away from the bear as it destroys the campsite behind her.
The campsite is in Yosemite National Park, with believable natural details. The time of day is dusk, with natural lighting and realistic colors. Everything should feel grounded, authentic, and unstyled, as if captured in a real moment. Avoid cinematic lighting, dramatic color grading, or stylized composition.
人物在营地场景中躲避棕熊的动作场面,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。
人物在营地场景中躲避棕熊的动作场面,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

多轮迭代:先出起始图,再只改一个条件

官方的迭代写法只有两条规则:把上一轮的输出作为下一轮的输入,以及每次只改一个条件。这样做的目的是让「哪一步起了作用」这件事可归因。

第一步用洗发水产品照做一块高速公路日落广告牌,提示词把广告牌文案放进引号,要求原样、只出现一次、清晰可读,并排除水印和 logo。第二步只有一句话:把它变成下雪的冬夜——场景、版式、文案全部沿用上一轮的结果。

官方编辑参数(两步相同):size="1024x1536",quality="medium"。

官方提示词 · 第一步(原文)
Create a realistic billboard mockup of the shampoo on a highway scene during sunset.
Billboard text (EXACT, verbatim, no extra characters):
"Fresh and clean"
Typography: bold sans-serif, high contrast, centered, clean kerning.
Ensure text appears once and is perfectly legible.
No watermarks, no logos.
官方提示词 · 第二步(原文)
Make it look like a winter evening with snowfall.
原始洗发水产品照片,作为多轮迭代的起始输入
输入图官方输入图:多轮迭代的起始输入。
日落高速路旁的洗发水广告牌,GPT Image 2.5 Flare 出图
第 1 轮 · Flare官方示例出图:第一步结果,Flare 档位。
日落高速路旁的洗发水广告牌,GPT Image 2.5 Sunburst 出图
第 1 轮 · Sunburst官方示例出图:第一步结果,Sunburst 档位。
改成下雪冬夜之后的洗发水广告牌,GPT Image 2.5 Flare 出图
第 2 轮 · Flare官方示例出图:第二步结果,Flare 档位。版式与文案沿用上一轮。
改成下雪冬夜之后的洗发水广告牌,GPT Image 2.5 Sunburst 出图
第 2 轮 · Sunburst官方示例出图:第二步结果,Sunburst 档位。

角色一致性:先立角色,再换场景

给一本多插画的书做图,官方建议先建立一个可复用的角色参考,再在不同场景、姿势和页面之间复用它。做法是把角色的外貌、比例、服装和气质写成一段固定的定义,每换一个场景就把这组定义重复一遍。

官方参数(第 1 步为生成,第 2 步为编辑):size="1024x1536",quality="medium"。

官方提示词 · 立角色(原文)
Create a children's book illustration introducing a main character.

Character:
A young, storybook-style hero inspired by a little forest outlaw,
wearing a simple green hooded tunic, soft brown boots, and a small belt pouch.
The character has a kind expression, gentle eyes, and a brave but warm demeanor.
Carries a small wooden bow used only for helping, never harming.

Theme:
The character protects and rescues small forest animals like squirrels, birds, and rabbits.

Style:
Children's book illustration, hand-painted watercolor look,
soft outlines, warm earthy colors, whimsical and friendly.
Proportions suitable for picture books (slightly oversized head, expressive face).

Constraints:
- Original character (no copyrighted characters)
- No text
- No watermarks
- Plain forest background to clearly showcase the character
官方提示词 · 延续故事(原文)
Continue the children's book story using the same character.

Scene:
The same young forest hero is gently helping a frightened squirrel
out of a fallen tree after a winter storm.
The character kneels beside the squirrel, offering reassurance.

Character Consistency:
- Same green hooded tunic
- Same facial features, proportions, and color palette
- Same gentle, heroic personality

Style:
Children's book watercolor illustration,
soft lighting, snowy forest environment,
warm and comforting mood.

Constraints:
- Do not redesign the character
- No text
- No watermarks
儿童绘本风格的森林小英雄角色介绍图,GPT Image 2.5 Flare 出图
立角色 · Flare官方示例出图:第 1 步建立角色,Flare 档位。
儿童绘本风格的森林小英雄角色介绍图,GPT Image 2.5 Sunburst 出图
立角色 · Sunburst官方示例出图:第 1 步建立角色,Sunburst 档位。
同一个森林小英雄在冬日雪林中救助松鼠的插画,GPT Image 2.5 Flare 出图
续表 · Flare官方示例出图:第 2 步沿用同一角色,Flare 档位。
同一个森林小英雄在冬日雪林中救助松鼠的插画,GPT Image 2.5 Sunburst 出图
续表 · Sunburst官方示例出图:第 2 步沿用同一角色,Sunburst 档位。

工作流一:替换房间里的家具

官方把这类需求的目标定义为「外科手术式的真实感」:只换一个物体,同时保住机位、光线、阴影和周围环境,让结果看起来像一张真实照片而不是重新设计。提示词的结构就是「只换 X + 冻结清单 + 材质要求」。

官方编辑参数:size="1536x1024",quality="medium"。

官方提示词(原文)
In this room photo, replace ONLY the white chairs with chairs made of wood.
Preserve camera angle, room lighting, floor shadows, and surrounding objects.
Keep all other aspects of the image unchanged.
Photorealistic contact shadows and fabric texture.
放有白色椅子的原始厨房照片
输入图官方输入图:原始厨房照片。
白色椅子被替换为木椅后的厨房照片,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。
白色椅子被替换为木椅后的厨房照片,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

工作流二:设计节日贺卡

季节性卡片要同时交代场景、情绪、材质、光线和确切文案。官方示例用怀旧泰迪熊场景演示,并且把「只允许出现这句文案」单独写成一条要求,原文照抄。

官方生成参数:size="1024x1536",quality="medium"。

官方提示词(原文)
Create a Christmas holiday card illustration.

Scene:
a cozy Christmas scene with an old teddy bear sitting inside a keepsake box, slightly worn fur, soft stitching repairs, placed near a window with falling snow outside. The scene suggests the child has grown up, but the memories remain.

Mood:
Warm, nostalgic, gentle, emotional.

Style:
Premium holiday card photography, soft cinematic lighting,
realistic textures, shallow depth of field,
tasteful bokeh lights, high print-quality composition.

Constraints:
- Original artwork only
- No trademarks
- No watermarks
- No logos

Include ONLY this card text (verbatim):
"Merry Christmas — some memories never fade."
窗边放着旧泰迪熊的圣诞贺卡插图,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。检查卡片文案是否原样出现。
窗边放着旧泰迪熊的圣诞贺卡插图,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

工作流三:设计收藏玩具与包装

周边与包装概念图靠的是产品摄影那套线索:材质、包装和印刷清晰度。官方要求设计保持原创且不侵权,并建议一次比较多个角色或包装变体。包装上的文案同样单独写成一条、原文照抄。

官方生成参数:size="1024x1536",quality="medium"。

官方提示词(原文)
Create a collectible action figure of a vintage-style toy propeller airplane with rounded wings, a front-mounted spinning propeller, slightly worn paint edges, classic childhood proportions, designed as a nostalgic holiday collectible, in blister packaging.

Concept:
A nostalgic holiday collectible inspired by the simple toy airplanes
children used to play with during winter holidays.
Evokes warmth, imagination, and childhood wonder.

Style:
Premium toy photography, realistic plastic and painted metal textures,
studio lighting, shallow depth of field,
sharp label printing, high-end retail presentation.

Constraints:
- Original design only
- No trademarks
- No watermarks
- No logos

Include ONLY this packaging text (verbatim):
"Christmas Memories Edition"
节日包装中的收藏款玩具螺旋桨飞机,GPT Image 2.5 Flare 出图
Flare官方示例出图:Flare 档位。
节日包装中的收藏款玩具螺旋桨飞机,GPT Image 2.5 Sunburst 出图
Sunburst官方示例出图:Sunburst 档位。

可运行的完整示例

官方还给了一段可以直接跑的示例:一次请求生成四个 logo 变体,再从一个参考图里抠出产品。官方说明这段示例固定使用 gpt-image-2,定位是基线,实际评估时再换成当前可用的模型和它支持的请求设置。

运行前需要安装 OpenAI SDK(Python 用 pip install openai),设置 OPENAI_API_KEY,并把产品照片保存为 input_images/shampoo.webp。官方提醒,真实请求会产生 API 费用。

  • 官方页面同时提供 Python 与 Ruby 两个版本,这里照录 Python 版。
  • 生成 logo 时保留返回的 PNG 字节,包括 alpha 通道。
  • 抠图那一步的提示词与上文「透明产品抠图」场景完全一致,可以对照使用。
官方 Python 示例(原文)
import base64
from pathlib import Path

from openai import OpenAI

client = OpenAI()


prompt = """
Create an original, non-infringing logo for a company called Field & Flour, a local bakery.
The logo should feel warm, simple, and timeless. Use clean, vector-like shapes, a strong silhouette, and balanced negative space.
Favor simplicity over detail so it reads clearly at small and large sizes. Flat design, minimal strokes, no gradients unless essential.
Fully transparent background. Deliver a single centered logo with generous padding, clean alpha edges, and no solid backdrop, scenery, checkerboard, or watermark.
"""

result = client.images.generate(
    model="gpt-image-2",
    prompt=prompt,
    size="1024x1536",
    quality="medium",
    background="transparent",
    output_format="png",
    n=4,  # Generate 4 versions of the logo
)

# Preserve the returned PNG bytes, including the alpha channel.
for index, item in enumerate(result.data, start=1):
    Path(f"logo-generation-{index}-gpt-image-2.png").write_bytes(
        base64.b64decode(item.b64_json)
    )

# Extract a product from a reference image.
prompt = """
Extract the product from the input image and isolate it on a fully transparent background.
Output: centered product, crisp silhouette, no halos/fringing.
Preserve product geometry and label legibility exactly.
Add only light polishing. Do not add a solid backdrop, checkerboard, scenery, or shadow.
Do not restyle the product; remove the background and preserve clean alpha transparency.
"""

result = client.images.edit(
    model="gpt-image-2",
    image=[
        Path("input_images/shampoo.webp"),
    ],
    prompt=prompt,
    size="1024x1536",
    quality="medium",
    background="transparent",
    output_format="png",
)

Path("extract-product-gpt-image-2.png").write_bytes(
    base64.b64decode(result.data[0].b64_json)
)

交付之前:验收清单

官方在指南最后给了一份检查清单,编辑类结果尤其需要过一遍——因为编辑最容易在「你没提到的地方」出问题。

  • 必需文字是否准确、清晰可读?图表标注和它们之间的关系是否正确?
  • 身份、产品外形、标签和参考细节是否保持完整?
  • 这次编辑是否只改了你要求改的地方?
  • 需要透明背景时,文件里是不是真的带了 alpha 通道,而不是画了一个背景上去?
  • 换提示词或换模型时,要在有代表性的输入上比较质量、延迟和成本。

常见问题

编辑图片和生成图片在写法上有什么不同?

官方把编辑的写法总结成一句话:说清「只改 X」,并列出要保留的细节。要保留的对象包括身份、几何、版式、光线和标签;同时要声明排除项,例如不要多余文字、logo 或水印。做局部精修时,还要点名饱和度、对比度、箭头、机位和周围物体这些必须保持不变的元素。

为什么多轮编辑之后人物或产品会越改越不像?

官方明确提示重复编辑仍然可能改掉你想保留的细节,处理方式是每次都重申约束并逐张检查。如果某个区域必须逐像素保持一致,官方建议把通过的编辑结果合成回原图,而不是继续靠提示词约束。

多张参考图要怎么在提示词里用?

官方要求给参考图分配角色:按编号和用途标识每张输入图,说明它是主体、风格、服装还是背景,再说清它们怎么组合、哪些元素要移到哪里。官方示例里就是「把第二张图里的狗放进第一张图的场景」,并为每张输入图标注了编号。

透明背景的抠图为什么有时候会失败?

官方要求双层保障:提示词里明确要求把主体单独抠在完全透明的背景上,并说明不要加实底、棋盘格、场景或阴影;参数侧同时设 background="transparent",输出用 PNG 或 WebP。官方还提醒画上去的棋盘格不是透明,必须检查解码后的 alpha 通道。

线稿转写实最容易出什么问题?

官方把这类工作流定位为「保留原意、补上真实感」:要求保持精确的版式、比例和透视,自行选择与草图意图一致的写实材质和光线,并明确写「不要新增元素或文字」,否则模型会自由发挥把构图改掉。

官方那段可运行的代码示例可以直接用吗?

官方说明该示例固定使用 gpt-image-2,用途是作为基线,实际评估时再换成当前可用的模型和它支持的请求设置。示例需要安装 OpenAI SDK,设置 OPENAI_API_KEY,并把产品照片保存为 input_images/shampoo.webp;真实请求会产生 API 费用。

拿一张自己的图来试

编辑类提示词的差距在实图上一眼就能看出来。打开 GPT Image 2.5 工作区,上传一张参考图,把下面的模板换成你自己的约束。

打开 GPT Image 2.5 出图工作台