POST /beta/ai/image-generations/{generationRequestId}/images/{index}/extend

AI Generator - Image Extension

Use text prompts and numerical values to extend the content beyond the borders of a previously generated image. Use of this endpoint is restricted to clients with an AI Generation license product and may result in the deduction of a credit depending on the terms of your license.

Extension involves adding content to one or more sides of an image by specifying a percentage by which you want the image extended. This means that the aspect ratio of the generated images will differ from the original unless the same value is specified for all four sides. Additionally, the pixel dimensions on the longest side will remain the same - 612px for the images provided in this endpoint's response, 1024px and 4096px on the images retrieved through the download process.

The Image Extend Request

The ImageExtendRequest payload requires at least one percentage to be greater than zero (left_percentage, right_percentage, top_percentage, or bottom_percentage) and accepts the following optional parameters:

ParameterPurpose
promptThe primary text used for the extended portion of the images.
negative_promptConcepts to exclude from the extended portion.
product_idIf you have multiple AI Generation Getty Images products, indicate which one you would like to use for this extension request. If you have multiple products, this property is required.
notesA note for the download. Some products require a note.
project_codeThe project code for the download. Some products require a project code.
left_percentagePercentage to add to the left side of the image. This must be a float that is equal to or greater than 0. Default is 0.
right_percentagePercentage to add to the right side of the image. This must be a float that is equal to or greater than 0. Default is 0.
top_percentagePercentage to add to the top side of the image. This must be a float that is equal to or greater than 0. Default is 0.
bottom_percentagePercentage to add to the bottom side of the image. This must be a float that is equal to or greater than 0. Default is 0.

Fulfilled and Pending Results

In many cases the result of this call will be the final fulfilled result. In these cases, you will see a HTTP 200 OK result and a payload including URLs to the result images and a generation request id value.

However some generations may take more time than can be accommodated in the initial call. In these cases the result of this call is HTTP 202 Accepted and the payload will only contain a generation request id value. This value must be retained by the client for subsequent polling of the GET beta/ai/image-generations/{generationRequestId} Get Images Generation endpoint.

Lifetime of Generated Images

Generated images will be retained for 6 months after generation.

Servers

Path parameters

Name Type Required Description
generationRequestId String Yes

The ID from a previous request to generate images

index Integer Yes

The index of the image from the specific images generation

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
prompt String No

This is the primary text used for the extension of the image.

project_code String No

The project code to use for the request. Some products require this value.

bottom_percentage Number No

The percentage to add to the bottom of the image.

notes String No

The notes to use for the request. Some products require this value.

left_percentage Number No

The percentage to add to the left side of the image.

right_percentage Number No

The percentage to add to the right side of the image.

negative_prompt String No

Concepts to exclude from the result

top_percentage Number No

The percentage to add to the top of the image.

product_id Integer No

If you have multiple Getty products, indicate which one you would like to use for this extend request

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.