VirtualTryOnModelInstance

Media generation input format for the Virtual Try On model.

Fields
prompt string

The text prompt describing the desired image.

productImages[] object (ProductImage)

Minimum of 1 and maximum of 3 product images to try on the person.

personImage object (PersonImage)

The image of the person to virtually try-on clothing.

JSON representation
{
  "prompt": string,
  "productImages": [
    {
      object (ProductImage)
    }
  ],
  "personImage": {
    object (PersonImage)
  }
}

ProductImage

A ProductImage is used to provide the product image and its associated configuration options for Virtual Try On.

Fields
image object (Image)

Required. An image of a product to virtually try on a person. The following values are supported: - A bytesBase64 encoded string that encodes the image. - A gcsUri string URI to a Google Cloud Storage bucket location.

maskImage object (Image)

(Optional) The mask image associated with this product. If provided, the mask image is used to guide the image editing.

productImageConfig object (ProductImageConfig)

The configuration for the product image.

JSON representation
{
  "image": {
    object (Image)
  },
  "maskImage": {
    object (Image)
  },
  "productImageConfig": {
    object (ProductImageConfig)
  }
}

Image

Represents the input image and metadata for virtual try-on.

Fields
mimeType string

The MIME type of the image. The following values are supported: - image/jpeg - image/png

data Union type
Image content for virtual try-on. The following values are supported: - A bytesBase64 encoded string that encodes the image. - A gcsUri string URI to a Google Cloud Storage bucket location. data can be only one of the following:
bytesBase64Encoded string

The base64-encoded bytes of the image.

gcsUri string

The Google Cloud Storage URI of the image. The URI must be in gs:// format.

JSON representation
{
  "mimeType": string,

  // data
  "bytesBase64Encoded": string,
  "gcsUri": string
  // Union type
}

ProductImageConfig

Configuration for the product image.

Fields
maskMode enum (MaskMode)

Mode used to control the segmentation logic.

dilation number

(Optional) Factor for dilating the mask. Valid values are in [0.0, 1.0]. If unset, dilation defaults to 0.

productDescription string

(Optional) A text description of the product.

JSON representation
{
  "maskMode": enum (MaskMode),
  "dilation": number,
  "productDescription": string
}

PersonImage

An image of a person. The model generates a virtual try-on image with the supplied image of the person wearing the garments from productImages.

Fields
image object (Image)

Required. An image of a person to try-on the clothing product. The following values are supported: - A bytesBase64 encoded string that encodes the image. - A gcsUri string URI to a Google Cloud Storage bucket location.

JSON representation
{
  "image": {
    object (Image)
  }
}