Create beautiful product photo

Generating background is fantastic way of improving product photo look. It can be even solution for creating product pack shots without need of manually taking expensive commercial photo shoots. It automatically removes background around the main subject, places it in the center of specified canvas (width and height API parameters) and generates image around the subject.

There are two types of background generation:

  1. Blended (original image over the generated background) Pros: the product stays identical to the original, no risk of product distortion, predictable result, product can be positioned freely, Cons: less creative freedom, the product cannot be naturally integrated into the scene (e.g., held in a hand), weaker light/shadow interaction with the environment.

  2. Fully generative Pros: the product can be modified by the scene (e.g., covered by something or held in a hand), higher creative freedom and more realistic scene integration. Cons: limited generation resolution (1024×1024), risk that the product may look different from the original.

Blended background generation

Parameter
Description

description

Text prompt describing the scene

item_area_percentage

Parameter between 0 and 1 that controls size of the object which is placed in the middle of final image. So, 0.85 is 85%

sample_num

Seed for random generator. Basically is "id" of generated image. When not specified, image will randomly different every time.

color

When color is specified, generated background is converted to b&w and then to specified color. It works best for prompts such as: "item standing on plain white background". Color has to be RGB array - f.e. [255,255,255]

Let's place the bottle of perfumes from below photo in other environment.

We can specify also image resolution:

When specifying a color:

Generative background generation

Last updated