Notebooks
O
OpenAI
Generate Images With High Input Fidelity

Generate Images With High Input Fidelity

chatgptopenaigpt-4examplesopenai-apiopenai-cookbook

Generate images with high input fidelity

This cookbook shows how you can leverage the input_fidelity parameter, available in the Image API and the Responses image generation tool, to preserve distinctive features from the input.

Setting input_fidelity="high" is especially useful when editing images with faces, logos, or any other details that require high fidelity in the output.

If you're not already familiar with image generation using the OpenAI API, we recommend starting with our introductory image generation cookbook.

Set-up

[ ]
[1]
[2]
[3]

Precise editing

High input fidelity allows you to make subtle edits to an image without altering unrelated areas. This is ideal for controlled, localized changes.

Example use cases:

  • Item edits: Change isolated elements (e.g., swap a mug color) while leaving everything else untouched.
  • Element removal: Cleanly remove an isolated element without changing the rest of the picture.
  • Element addition: Seamlessly insert new objects into a scene.
[4]
Output

Item edit

[5]
[42]
Output

Remove item

[7]
[43]
Output

Add item

[9]
[44]
Output

Face preservation

When using high input fidelity, faces are preserved far more accurately than in standard mode. Use this when you need people to remain recognizable across edits.

Example use cases:

  • Image editing: Edit your photos while preserving facial features.
  • Personalization: Create avatars that still look like the original person across different backgrounds or styles.
  • Photo merge: Combine faces from multiple pictures into one image.

Note: Currently, while all input images are preserved with high fidelity, only the first one you provide is preserved with extra richness in texture. When working with multiple faces from different photos, try combining all needed faces into a single composite image before sending the request (see the example below).

[11]
Output

Image editing

[12]
[45]
Output

Avatar

[14]
[46]
Output

Combine multiple pictures with faces

[16]
Output
[17]
[54]
Output
[20]
[21]
[47]
Output

Branding consistency

Sometimes, maintaining brand identity in generated images is essential. High input fidelity ensures that logos and other unique design elements remain true to the original assets.

Example use cases:

  • Marketing assets: Generate banners or social posts that include your brand logo without distortion.
  • Mockups: Place your logo or other brand assets into templates or lifestyle scenes without unintended changes.
  • Product photography: Change a product’s background for different campaigns while keeping the product's details crisp.
[23]
Output

Marketing assets

[24]
[48]
Output