#Inpainting

1 messages · Page 1 of 1 (latest)

real fern
#

Is there inpainting in the api?

spring craneBOT
#

Hi @real fern. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Yes, inpainting (editing part of an image by specifying a mask) is supported in the OpenAI API, but only with certain models and endpoints:

  • With the GPT Image model (gpt-image-1), you can perform inpainting by providing a mask PNG where transparent pixels indicate the area to replace. The mask must match the original image’s dimensions. This is available via the Image API's edits endpoint and the Responses API. The process is prompt-based, meaning the model uses the mask as guidance but may not follow its exact shape with complete precision. Example code and details are available in the documentation and help articles (Edit Images, Edit an image using a mask (inpainting), FAQ).

  • With DALL·E 2, inpainting is also supported via the edits endpoint. You can upload an image and a mask to specify which areas should be replaced (How to create dynamic masks with DALL·E and Segment Anything).

  • DALL·E 3 does not currently support inpainting or the edits endpoint; it only supports image generation (What's new with DALL·E 3?).

In summary: Inpainting is available in the API with GPT Image and DALL·E 2 models, but not with DALL·E 3 at this time.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: