v1

latestOpenAPI 3.0.02026-07-13650400.5 KB
Product Shots Generation

Lifestyle Product Shot by Text

Creates enriched product shots by placing them in various environments using textual descriptions.

Additionally, you can change the image size of the final result as well as the positioning of the product in the image. This will enable you to create new and unique variations of your original image.

This capability is based on our BRIA 2.3 ControlNet BG-Gen. HF model card is available <a href="https://huggingface.co/briaai/BRIA-2.3-ControlNet-BG-Gen" target="_blank">here</a>. HF demo space of this pipeline can be found <a href="https://huggingface.co/spaces/briaai/Product-Shot-Generation" target="_blank">here</a>.

post/product/lifestyle_shot_by_text

Headers

api_tokenstring required

API token associated with the organization.

Request body

skustring

The Stock Keeping Unit identifier for the product. This parameter is optional.

syncboolean

Determines the response mode. When true, responses are synchronous. With false, responses are asynchronous, immediately providing URLs for images that are generated in the background. It is recommended to use sync=false for optimal performance. When generating more than 1 result, you should use the value false. When placement_type is automatic, sync has to be false.

fastboolean

Determines the generation mode. When true, the generation will utilize the fast mode which provides the best balance between speed and quality. The false, the regular mode will be utilized.

image_urlstring

The URL of the product shot to be placed in a lifestyle shot. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB.

filestring

The product shot file to be placed in a lifestyle shot, in base64 format. Used if image_url is not provided. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB.

scene_descriptionstring

Text description of the new scene or background for the provided product shot. Bria currently supports prompts in English only, excluding special characters.

optimize_descriptionboolean

When true, an additional logic takes the scene_description that was included and adjusts it to achieve optimal results. Built with Meta Llama 3.

num_resultsinteger

The number of lifestyle product shots you would like to generate. You will get num_results x 10 results when placement_type=automatic and according to the number of required placements x num_results if placement_type=manual_placement.

exclude_elementsstring

Elements or features that should be excluded from the generated scene. This parameter is optional and is available only when fast=false. Bria currently supports descriptions in English only, excluding special characters.

placement_type'original' | 'automatic' | 'manual_placement' | 'manual_padding' | 'custom_coordinates'

This parameter allows you to control the positioning of the product in the image.

  • original will preserve the original position of the product in the image.
  • automatic will generate results with 7 of the recommended positions for the product (all except the upper ones).
  • manual_placement will allow you to select predefined positions, using the parameter "manual_placement_selection".
  • custom_coordinates Provides precise control over the size and position of the image using the parameters "foreground_image_size" and "foreground_image_location". This includes positions outside the canvas, which may result in cropping.
  • manual_padding will allow you to control the position and size of the image by defining the desired padding in pixels around the product.
original_qualityboolean

This flag is only relevant when placement_type=original. If true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio.

shot_sizeinteger[]

The desired size of the final product shot. For optimal results, the total number of pixels should be around 1,000,000. This parameter is only relevant when placement_type is automatic,manual_placement or custom_coordinates.

foreground_image_sizeinteger[]

Specifies the desired dimensions of the foreground image within the generated output. The size is defined as an array of integers representing [width, height] in pixels.

foreground_image_locationinteger[]

Specifies the desired [x, y] coordinates for positioning the foreground image within the full shot. The coordinates represent the upper-left corner of the foreground image. Values can extend outside the shot, in which case the input image will be cropped accordingly.

manual_placement_selectionstring[]

If you've selected placement_type=manual_placement, you should use this parameter to specify which placements/positions you would like to use from the list. You can select more than one placement in one request.

padding_valuesinteger[]

The desired padding in pixels around the product, when using placement_type=manual_padding. The order of the values is [left, right, top, bottom]. For optimal results, the total number of pixels, including padding, should be around 1,000,000. It is recommended to first use the product cutout API, get the cutout and understand the size of the result, and then define the required padding and use the cutout as an input for this API.

force_rmbgboolean

Forces background removal, even if the original image already contains an alpha channel. Useful for refining existing foreground/background separation or ignoring unnecessary alpha channels.

Response

Successful operation.

Example response

{
  "result": [
    [
      "result_url",
      244184855
    ]
  ]
}