Method: accounts.generatedImages.generateProductImageBackground

generatedImages.generateProductImageBackground generates a new image where the background of the original image is replaced by an AI generated scene based on provided product information and a text prompt.

HTTP request

POST https://merchantapi.googleapis.com/productstudio/v1alpha/{name=accounts/*}/generatedImages:generateProductImageBackground

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The account for which to generate an image. This acts as a container for the request and does not affect the generation itself. Format: accounts/{account}

Request body

The request body contains data with the following structure:

JSON representation
{
  "outputConfig": {
    object (OutputImageConfig)
  },
  "inputImage": {
    object (InputImage)
  },
  "config": {
    object (GenerateImageBackgroundConfig)
  }
}
Fields
outputConfig

object (OutputImageConfig)

Optional. Configuration for how the output image should be returned.

inputImage

object (InputImage)

Required. The input image.

config

object (GenerateImageBackgroundConfig)

Required. Configuration parameters for the generation of the background.

Response body

Response message for the generatedImages.generateProductImageBackground method.

If successful, the response body contains data with the following structure:

JSON representation
{
  "generatedImage": {
    object (GeneratedImage)
  }
}
Fields
generatedImage

object (GeneratedImage)

The generated output image.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

GenerateImageBackgroundConfig

Client provided input configuration for generating the background.

JSON representation
{
  "productDescription": string,
  "backgroundDescription": string
}
Fields
productDescription

string

Required. Example: "Hat on a baseball field" "Hat" = product description Description of product.

backgroundDescription

string

Required. Example: "Hat on a baseball field" "on a baseball field" = background description Description of wanted background.