Comment on page
Scene
Learn how to control the quality and speed of image generation.
AI Photoshoot API provides you with two ways to create a background for your product:
- Template-free approach
- Template-based approach
In the template-free approach, only the prompts are used for background generation.
AI Photoshoot API accepts text prompts to generate background. The
prompt
must be between 3 and 2048 characters.Provide a detailed prompt to increase the likelihood of achieving the desired result.
{
"scene": {
"prompt": "on the wooden table in the dark room"
}
}
The negative prompt is a parameter that specifies what you don't want to see on the generated background. When specified, it tells the generation process not to include things in the image that match a given text. The
negative_prompt
must be between 3 and 2048 characters.{
"scene": {
"prompt": "on the wooden table in the dark room",
"negative_prompt": "pixelated, low quality"
}
}
Parameter | Type | Range | Default value |
---|---|---|---|
prompt | str | 3 - 2048 | is required |
negative_prompt | str | 3 - 2048 | text, watermark, man, woman, child, overlay text, cartoon, pixelated, illustration, ugly, painting, cropped, lowres, low quality, jpeg artifacts, signature, logo |
In the template-based approach, you can use a sample image that will be used to generate a background similar to the image, and you can also use prompts to increase the likelihood of achieving the desired result.
AI Photoshoot API supports several options to provide a sample images that will be used to generate background.
If you upload a non-square image, it will be scaled and cropped to fit a square.
URL of the input image should be from 1 to 4096 characters. The image must be accessible by our system.
{
"scene": {
"template_url": "https://letsenhance.io/docs/assets/samples/scene.jpg"
}
}
You can connect Cloud Storage and use it as a source for images. Currently, our API supports AWS S3 and Google Cloud Storage.
After connecting your Cloud Storage, you can refer the storage name as an input.
{
"scene": {
"template_url": "storage://storage-name/path/scene.jpg"
}
}
The API supports the following image formats as inputs: BMP, GIF, JPEG, PNG, TIFF, WEBP, AVIF, and HEIC.
The template mode describes how closely the background should match the template. You can either preserve maximum details of the template image and make the resulting background as similar as possible using
lock
template mode, or you can change the result background with prompt
and color
using transform
template mode. See Color and Prompts for more info.prompt
and color
are unavailable for lock
template mode.Viewpoint | Text |
---|---|
transform | Template is transformed according to the prompt and color . |
lock | Template is preserved with maximum detail. |
transform
template mode is used by default.{
"scene": {
"template_url": "storage://storage-name/path/scene.jpg",
"template_mode": "lock"
}
}
The template viewpoint describes the camera position and tilt angle from which the photo was taken. Available viewpoints are listed below:
Viewpoint | Text |
---|---|
top | The view is top-down, looking down on the subject from above. |
front | The view is horizontal, looking directly on the subject. |
front
viewpoint is used by default.{
"scene": {
"template_url": "storage://storage-name/path/scene.jpg",
"view": "top"
}
}
If you want to change the color of the background, you can specify the desired color in hexadecimal format and it will be used as the main color of the image sample-based background.
Using color will make the resulting background look closer to the sample image.
{
"scene": {
"template_url": "storage://storage-name/path/scene.jpg",
"color": "#8fa782"
}
}
You can use
prompt
and negative_prompt
in the same way as in the template-free approach, but prompt
is not a required parameter for template-based approach.Parameter | Type | Range | Default value |
---|---|---|---|
template_url | str | 1 - 4096 | is required |
view | str | top , front | front |
color | str | #000000 - #ffffff | |
prompt | str | 3 - 2048 | |
negative_prompt | str | 3 - 2048 | text, watermark, man, woman, child, overlay text, cartoon, pixelated, illustration, ugly, painting, cropped, lowres, low quality, jpeg artifacts, signature, logo |
The template image viewpoint (camera position and tilt angle from which the photo was taken) should match the viewpoint of the product image.
Last modified 18d ago