The Bria API

We are happy to answer any questions you may have at: support@bria.ai

Introduction

The Bria API is intended for users to interact with BriEngine and perform various operations, such as generating new images, customizing uploaded images, and searching. This document will provide an overview of the API's capabilities and guide users on how to effectively implement it.

The following routes can be used without calling first to Upload/Register Routes:

  • background/remove - Using the Isolated Background Removal to remove the background of an image.
  • /text-to-image - By using the Image Generation route, you can generate any image you would like, based on the provided prompt.

The common use of the Bria API is according to the following order:

  • /upload - By using the Upload Route, you can upload a new image to the Bria database.
  • /register - By using the Register Route, a new image can be sent to Bria without being uploaded to the database.

With the response from the Upload/Register Routes (visual_id), the following routes can be used without any particular order:

  • /campaign_generator - The Campaign Generator Route enables the creation of customized campaigns. It allows for the generation of visual ads, including various elements like text, images, and layout, based on specific parameters provided by the user.
  • /info - By using the Info Route, you can understand the possible changes for each object in the image. The following routes can be used if you do not require information for people, objects, and background, but rather only one of them:
    • /person/info
    • /objects/info
    • /background/info
  • /increase_resolution - The Increase Resolution route is used to upsacle any image.
  • /image_to_psd - The Image To Psd route is used to create a layered psd file out of any image.
  • /mask_generator - By using the Mask Generator, you can get all the available masks for an image, a segmentation for the image.
  • /search - Utilizing the Search Route to look for images you uploaded or registered to Bria that match a text query.
  • /search_similar_images - Utilizing the Search Similar Images Route to look for images you uploaded or registered to Bria that match the chosen image.
  • /caption - By using the Caption Route, you can get a caption that describes the given image.
  • /crop - The Crop Route is used to crop an image without a background, tightly around the remaining region of interest.

With the response from the Info Routes or from the Mask Generator, the following routes can be used without any particular order:

  • /create - Using the Create Route to create a new visual with requested changes of elements according to the /info route possibilities.
  • /recast_model - Using the Recast Model Route to create a new variation of your image, while customizing a portrait to any profession/theme
  • objects/remove - Using the Remove Object Route to remove the objects from an image. You can also use this route with any mask, that is created manually by a user or generated by the /mask_generator endpoint.
  • background/remove - Using the Remove BG Route to remove the background of an image.
  • background/blur - Using the Blur BG Route to create a blur effect on the background of an image.
  • /replace_bg - Using the Replace BG Route to generate new backgrounds for an image.

Quality Predictions

The "Oracle" capability within the API can significantly elevate the user experience by offering quality prediction functionalities.

With the Oracle integrated into your product, you can ensure optimal outcomes for your end users.

This feature covers various endpoints, including /create, objects/remove, and background operations, providing you with a range of quality prediction options to enhance your product's capabilities.

The orcale value predicts the quality of the result, for each possible action.

By using the "info" for all endpoints, "person/info" endpoint for face modifications, "objects/info" for object removal, and "background/info" for background actions, you can access the Oracle's predictions, and help your users to make informed decisions.

Incorporating Oracle predictions into the API workflow enhances efficiency, minimizes errors, and fosters an optimized API experience.

Authentication

The Bria API consists of a number of methods for uploading and creating new visual assets. The REST (representational state transfer) API methods can be called directly from within your own custom code.

curl --location --request POST 'https://engine.prod.bria-api.com/v1' \
--header: 'api_token: <...>' \
...

API Access

You can register and access the API Token through Bria's platform by clicking here.

Image

/text-to-image/base

Description

The /text-to-image/base Route empowers users to create stunning images directly from textual prompts. This model allows for generating high-quality, photorealistic and artistic, images with a resolution of up to 1024x1024 pixels, supporting a variety of aspect ratios natively to accommodate diverse creative needs.

Versions:

Version 2.2: Scheduled for deprecation on May 1st, 2024. Requests with this version will automatically be transitioned to version 2.3 to ensure continuous improvement and access to the latest features.

Version 2.3: Offers a slight improvement over version 2.2, particularly in illustrations and art, enhancing the aesthetic appeal and creative potential of generated images. While it elevates artistic visuals, it maintains parity with version 2.2 in delivering photorealistic visuals. Version 2.3 is the recommended option to use.

Advanced Customization and Access:

Beyond the API, developers interested in deeper customization can access BRIA's models directly through Hugging Face. This alternative provides access to the underlying model source code, offering additional features such as ControlNets: Canny , Depth, and ReColoring. This option is ideal for developers seeking advanced control over the image generation process and those who wish to integrate cutting-edge AI directly into their workflows.

Examples:

prompt: A professional headshot of a CEO

BRIA BASE model 2.3:

prompt: A vaporwave detailed illustration of a street in London in pastel hues, under a Union Jack sky

BRIA BASE model 2.2:

BRIA BASE model 2.3:

prompt: A portrait of a Beautiful and playful ethereal singer, art deco, fantasy, intricate art deco golden designs, elegant, highly detailed, sharp focus, blurry background, teal and orange shades

BRIA BASE model 2.2:

BRIA BASE model 2.3:

Request
path Parameters
model_version
required
string

The model version you would like to use in the request.

Enum: "2.2" "2.3"
header Parameters
api_token
required
string
Request Body schema: application/json
required
prompt
string

The prompt you would like to use to generate images.

num_results
integer [ 1 .. 4 ]
Default: 4

How many images you would like to generate.

aspect_ratio
string
Default: "1:1"

The aspect ratio of the image.

Enum: "1:1" "2:3" "3:2" "3:4" "4:3" "4:5" "5:4" "9:16" "16:9"
sync
boolean
Default: false

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. Use polling for the URLs to retrieve images once ready.

seed
integer

You can choose whether you want your generated result to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response with the prompt, model type and model version. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

negative_prompt
string

Specisfy here elements that you didn't ask in the prompt, but are being generated, and you would like to exclude. This parameter is optional.

steps_num
integer [ 20 .. 50 ]
Default: 30

The number of iterations the model goes through to refine the generated image. This parameter is optional.

text_guidance_scale
number <float> [ 1 .. 10 ]
Default: 5

Determines how closely the generated image should adhere to the input text description. This parameter is optional.

medium
string

Which medium should be included in your generated images. This parameter is optional.

Enum: "photography" "art"
prompt_enhancement
boolean
Default: false

When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. Note that turning this flag on may result in a few additional seconds to the inference time.

Responses
200

Successful operation.

400

Bad request.

405

Method not allowed.

500

Internal server error.

post/text-to-image/base/{model_version}
Request samples

/text-to-image/fast

Description

The /text-to-image/fast Route is optimized for speed, enabling rapid image creation without compromising quality. This model allows for generating high-quality, photorealistic and artistic, images with a resolution of up to 1024x1024 pixels, supporting a variety of aspect ratios natively to accommodate diverse creative needs. Ideal for applications requiring quick turnaround without sacrificing image fidelity. Versions:

Version 2.2: Scheduled for deprecation on May 15th, 2024. Requests with this version will automatically be transitioned to version 2.3 to ensure continuous improvement and access to the latest features.

Version 2.3: Offers a slight improvement over version 2.2, particularly in illustrations and art, enhancing the aesthetic appeal and creative potential of generated images. While it elevates artistic visuals, it maintains parity with version 2.2 in delivering photorealistic visuals. Version 2.3 is the recommended option to use.

Advanced Customization and Access:

Beyond the API, developers interested in deeper customization can access BRIA's models directly through Hugging Face. This alternative provides access to the underlying model source code, offering additional features such as ControlNets: Canny , Depth, and ReColoring. This option is ideal for developers seeking advanced control over the image generation process and those who wish to integrate cutting-edge AI directly into their workflows.

An example:

prompt: A portrait of a Beautiful and playful ethereal singer, art deco, fantasy, intricate art deco golden designs, elegant, highly detailed, sharp focus, blurry background, teal and orange shades

BRIA FAST model 2.3:

Request
path Parameters
model_version
required
string

The model version you would like to use in the request.

Enum: "2.2" "2.3"
header Parameters
api_token
required
string
Request Body schema: application/json
required
prompt
string

The prompt you would like to use to generate images.

num_results
integer [ 1 .. 4 ]
Default: 4

How many images you would like to generate.

aspect_ratio
string
Default: "1:1"

The aspect ratio of the image.

Enum: "1:1" "2:3" "3:2" "3:4" "4:3" "4:5" "5:4" "9:16" "16:9"
sync
boolean
Default: false

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. Use polling for the URLs to retrieve images once ready.

seed
integer

You can choose whether you want your generated result to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response with the prompt, model type and model version. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

negative_prompt
string

Specisfy here elements that you didn't ask in the prompt, but are being generated, and you would like to exclude. This parameter is optional.

steps_num
integer [ 4 .. 10 ]
Default: 8

The number of iterations the model goes through to refine the generated image. This parameter is optional.

text_guidance_scale
number <float> [ 1 .. 10 ]
Default: 5

Determines how closely the generated image should adhere to the input text description. This parameter is optional.

medium
string

Which medium should be included in your generated images. This parameter is optional.

Enum: "photography" "art"
prompt_enhancement
boolean
Default: false

When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. Note that turning this flag on may result in a few additional seconds to the inference time.

Responses
200

Successful operation.

400

Bad request.

405

Method not allowed.

500

Internal server error.

post/text-to-image/fast/{model_version}
Request samples

/text-to-image/hd

Description

The /text-to-image/hd Route is tailored for projects demanding the utmost in image detail and clarity. This model allows for generating high-quality, photorealistic and artistic, images with unparalleled resolution of 1920x1080 (1:1 1536x1536) pixel, supporting a variety of aspect ratios natively to accommodate diverse creative needs.

Advanced Customization and Access:

Beyond the API, developers interested in deeper customization can access BRIA's models directly through Hugging Face. This alternative provides access to the underlying model source code, offering additional features such as ControlNets: Canny , Depth, and ReColoring. This option is ideal for developers seeking advanced control over the image generation process and those who wish to integrate cutting-edge AI directly into their workflows.

Examples:

prompt: A photo of detailed short female blond hair viewed from behind, with rich texture and clearly visible individual strands that give depth and realism, and featuring subtle waves reflect light

BRIA HD model 2.2:

prompt: A portrait of a Beautiful and playful ethereal singer, art deco, fantasy, intricate art deco golden designs, elegant, highly detailed, sharp focus, blurry background, teal and orange shades

BRIA HD model 2.2:

Request
path Parameters
model_version
required
string

The model version you would like to use in the request.

Value: "2.2"
header Parameters
api_token
required
string
Request Body schema: application/json
required
prompt
string

The prompt you would like to use to generate images.

num_results
integer [ 1 .. 4 ]
Default: 4

How many images you would like to generate.

aspect_ratio
string
Default: "1:1"

The aspect ratio of the image.

Enum: "1:1" "2:3" "3:2" "3:4" "4:3" "4:5" "5:4" "9:16" "16:9"
sync
boolean
Default: false

Determines the response mode. When true, responses are synchronous, and applicable to single-image requests. With false, responses are asynchronous, immediately providing URLs for images that are generated in the background. Use polling for the URLs to retrieve images once ready.

seed
integer

You can choose whether you want your generated result to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response with the prompt, model type and model version. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

negative_prompt
string

Specisfy here elements that you didn't ask in the prompt, but are being generated, and you would like to exclude. This parameter is optional.

steps_num
integer [ 20 .. 50 ]
Default: 30

The number of iterations the model goes through to refine the generated image. This parameter is optional.

text_guidance_scale
number <float> [ 1 .. 10 ]
Default: 5

Determines how closely the generated image should adhere to the input text description. This parameter is optional.

medium
string

Which medium should be included in your generated images. This parameter is optional.

Enum: "photography" "art"
prompt_enhancement
boolean
Default: false

When set to true, enhances the provided prompt by generating additional, more descriptive variations, resulting in more diverse and creative output images. Note that turning this flag on may result in a few additional seconds to the inference time.

Responses
200

Successful operation.

400

Bad request.

405

Method not allowed.

500

Internal server error.

post/text-to-image/hd/{model_version}
Request samples

/generation/bria-v2/text-to-image (Deprecated)

Description

WARNING: Deprecated and scheduled for removal on 01/07/2024. For continued support, use /text-to-image.

The Image Generation Route allows you to generate images based on any given text prompt.

Our most capable model that can generate high-quality 1024x1024px images. The model supports natively multiple aspect ratios. Here are some examples:

prompt: A portrait of a Beautiful and playful ethereal singer, art deco, fantasy, intricate art deco golden designs, elegant, highly detailed, sharp focus, blurry background, teal and orange shades

results:

prompt: Nature photography, a majestic photo, closeup of a blue and yellow Cameleon on a tropical blue flower with due, drops of water on the flower, outdoors, vegetation, jungle, polarizing photo filter

results:

Request
header Parameters
api_token
required
string
Request Body schema: application/json
required
prompt
string

The prompt you would like to use to generate images

num_results
integer

How many images you would like to generate. The default and maximum value is 4.

size
Array of arrays
Default: [1024,1024]

The size of the image in pixels. The first value is the width and the second value is the height. Each value must be a multiple of 64. Here is the recommended list of sizes to use [1024,1024],[1344,768],[768,1344],[1088,896],[896,1088],[1152,896],[896,1152],[1216,832],[832,1216].

sync
boolean

Determines the response mode. When true, responses are synchronous, and applicable to the fast model or single-image requests. With false, responses are asynchronous, immediately providing URLs for images that are generated in the background. Use polling for the URLs to retrieve images once ready.

fast
boolean
Default: false

If you would like to use the Bria 2.2 Fast model, which provides the best balance between speed and quality, use the value true.

seed
integer

You can choose whether you want your generated result to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response with the prompt. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

negative_prompt
string

This parameter is optional.

steps_num
integer [ 20 .. 50 ]
Default: 30

The number of iterations the model goes through to refine the generated image. This parameter is optional.

text_guidance_scale
number <float> [ 1 .. 10 ]
Default: 5

Determines how closely the generated image should adhere to the input text description. This parameter is optional.

style
string

Which style you would like to see in your generated images.

Enum: "photo realistic" "fashion" "retro" "sports" "still life" "hyper realistic" "travel" "artistic" "3d render" "realistic" "fantasy" "comic book" "minimalistic"
atmosphere
string

Which atmosphere you would like to get in your generated images.

Enum: "dramatic" "vivid" "warm" "cool"
camera
string

Which camera angle you would like to see in your generated images.

Enum: "portrait" "close up" "aerial" "landscape"
medium
string

Which medium should be included in your generated images.

Enum: "photography" "art"
Responses
200

Successful operation.

400

Bad request.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

512

Insufficient resources to process the request.

post/generation/bria-v2/text-to-image
Request samples

/{visual_id}/campaign_generator

Description

The campaign_generator Route enables users to create visual campaigns for various ad channels using a visual_id. This route facilitates the generation of templates featuring diverse layouts that incorporate elements like text, logos, and calls to action (CTA), tailored to various resolutions (placements) and target audiences.

Ad backgrounds are expanded to fit the necessary layout specifications.

Examples

original image (Generated by Bria):

Results:

Request
path Parameters
visual_id
required
string
header Parameters
api_token
required
string
Request Body schema: application/json
required
sid
string

Session ID. Optional. obtained from a previous route response. Optional.

preset_id
string

Preset id. Optional. The brand preset that defines which logo, colors and typography should be used. If one isn’t provided, and some or none of the following are not provided (header1_color, header1_font, header1_size,header1_color, header1_font, header1_size, logo), the default public brand will be used.

template_id
string

Template ID, Mandatory. template_id or layout_ids must be provided. You can contact Bria to get your own templates and layouts.

layout_ids
Array of strings

Layout IDs, Mandatory. the ids of the layouts to generate. template_id or layout_ids must be provided. You can contact Bria to get your own templates and layouts.

logo
string

Logo URL. Optional. Supported inputs include public image URL or a URL inside Bria s3.

cta
string

CTA image URL. Optional. Supported inputs include public image URL or a URL inside Bria s3.

header1_text
string

Header1 text. Optional.

header1_font
string

Header1 font. Optional. Supported inputs include public ttf URL or a URL inside Bria s3.

header1_size
integer

Header1 size. Optional.

header1_color
Array of integers

Header1 color in hex format. Optional.

header2_text
string

Header2 text. Optional.

header2_font
string

Header2 font. Optional. Supported inputs include public tiff URL or a URL inside Bria s3.

header2_size
integer

Header2 size. Optional.

header2_color
Array of integers

Header2 color in hex format. Optional.

seed
integer

Seed used for image expansion. Optional. Use this to recreate the same ad.

background_type
string
Default: "original"

Background type. Optional.

Enum: "original" "generated" "solid"
bg_prompt
string

Background generation prompt. Mandatory when background_type is generated.

bg_seed
integer

Background seed. Optional. Relevant when background_type is generated.

bg_color
string

Background color in hex code. Mandatory when background_type is solid.

Responses
200

Successful response with generated campaign visuals.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

post/{visual_id}/campaign_generator
Request samples
Response samples
application/json
{
  • "ads": [
    ]
}

/{visual_id}/image_expansion

Description

The Image Expension Route can be used to expand an image and its background, by utilizing generative AI.

You can decide on the image size of the final result as well as the position and size of the original image compared to the final result.

In this way, you can create unique variations of your original image instead of cropping it into different aspect ratios and losing important details.

Here are some examples:

original image (Generated by Bria):

results:

original image (Stock Image):

results:

You can use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

Request
path Parameters
visual_id
required
string

The visual id of the image which the user wishes to expand

Example: 8487fb411f3c6716
header Parameters
api_token
required
string
Request Body schema: application/json
canvas_size
Array of integers
Default: [1000,1000]

The desired size of the final image, after the expansion.

original_image_size
Array of integers

The desired size of the original image, inside the full canvas.

original_image_location
Array of integers

The desired location of the original image, inside the full canvas. Provide the location of the upper left corner of the original image. The location can also be outside the canvas (the original image will be cropped).

prompt
string

Text on which you wish to base the image expansion. This parameter is optional.

seed
integer

You can choose whether you want your generated expension to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to modify the result of that route, please provide this information. This parameter is optional.

negative_prompt
string

This parameter is optional.

Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

512

Insufficient resources to process the request.

post/{visual_id}/image_expansion
Request samples

/image/increase_resolution

Description

The Isolated Increase Resolution Route is used to upsacle the resolution of any image.

The main difference between the regular and this isolated Increase Resolution endpoint is that you can use this endpoint without uploading or registering the image to Bria.

Constraints

The Bria API currently supports only JPEG and PNG files in RGB, RGBA, or CMYK color modes. When the file is of a different type or color mode, the status code 415 will be returned.

It's possible to increase the resolution of an image up to a total area of 8192x8192 pixels.

Increase the Resolution of an image using the image file

In our documentation request example, we demonstrate how to Increase the Resolutio of an image using the image URL.

If you want to use an image from a file, follow the example below:

  import requests

  url = "https://engine.prod.bria-api.com/v1/image/increase_resolution?desired_increase=2"

  payload = {}
  files=[
    ('file',('image_name.jpeg',open('/path_to_local_file/image_name.jpeg','rb'),'image/jpeg'))
  ]
  headers = {
    'api_token': 'xxxx'
  }

  response = requests.request("POST", url, headers=headers, data=payload, files=files)

  print(response.text)
            
Request
query Parameters
desired_increase
integer

The resolution multiplier. The possible value are 2,4. It's possible to increase the resolution of an image up to a total area of 8,192x8,192 pixels.

Example: desired_increase=2
header Parameters
api_token
required
string
Request Body schema: application/x-www-form-urlencoded
required
file
string <binary>

The image file you would like to increase the resolution for.

image_url
string

The URL of the image file you would like to increase the resolution for. The URL should lead to an image publicly available online. Either a file or an image_url should be provided. If both are provided, then the route will use image_url.

Responses
200

Successful operation.

400

Bad request

405

Method not allowed.

460

Failed to download image.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

/{visual_id}/increase_resolution

Description

The Increase Resolution Route is used to upsacle the resolution of any image.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

Request
path Parameters
visual_id
required
string

visual id of the image the user would like to upscale

Example: 8487fb411f3c6716
query Parameters
sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to apply on the result of that route, please provide this information. This parameter is optional.

Example: sid=Remove this parameter if the image has not been modified using Bria.
desired_increase
integer

The resolution multiplier. The possible value are 2,4.

Example: desired_increase=2
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

/{visual_id}/image_to_psd

Description

The Image to PSD Route is used to create a layered PSD file from any image.

The image is divided into different layers (depending on the image): a background layer with all identified objects removed, a foreground layer without the background, and a layer for each object.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

Request
path Parameters
visual_id
required
string

visual id of the image, for which the user would like to create a layered PSD file

Example: 8487fb411f3c6716
query Parameters
sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to apply on the result of that route, please provide this information. This parameter is optional.

Example: sid=Remove this parameter if the image has not been modified using Bria.
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

/{visual_id}/crop

Description

The Crop Route is used to crop an image without a background tightly around the remaining region of interest.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

On images without transparent backgrounds, the response will be the provided image at the selected resolution.

Request
path Parameters
visual_id
required
string

visual id of the image the user would like to crop

Example: 8487fb411f3c6716
query Parameters
sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to modify the result of that route, please provide this information. This parameter is optional.

Example: sid=Remove this parameter if the image has not been modified using Bria.
header Parameters
api_token
required
string
Request Body schema: application/json
optional
padding
integer
Default: 0

Cropping the object with padding around it. Currently, padding is applied to all four borders of the remaining region. This parameter is optional.

Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

Image Onboarding

/upload

Description

The Upload Route is used to upload visuals to the database. This route returns a visual identification to the user. It's the first step for consuming the Bria API for new visuals.

Response

The visual id in the response of the Upload Route must be kept by the user in order to query image info, modify the image and use the search routes.

{ "visual_id": "9ea9a4d2d19977a7c" }

The visual_id in the response of the /upload route will be used for all other routes. Store the visual_id in your database and map it to your image identification method for easy reference

Bria generative Web tool

The uploaded visual can be seen and used in the Bria generative web tool in cases where the tool is licensed as part of the project.

To do so, the user can access the following url: https://labs.bria.ai/gallery/{visual_id}, where the {visual_id} comes from the response of the /upload route.

Constraints

Files should not be larger than 12MB. The status code 413 will be returned if the file exceeds its maximum size.

The Bria API currently supports only JPEG and PNG files in RGB, RGBA, or CMYK color modes. When the file is of a different type or color mode, the status code 415 will be returned.

Upload using a file

In our documentation request example, we demonstrate how to upload an image using a URL.

If you want to upload an image from a file, follow the example below:

  import requests

  url = "https://engine.prod.bria-api.com/v1/upload"

  payload = {}
  files=[
    ('file',('image_name.jpeg',open('/path_to_local_file/image_name.jpeg','rb'),'image/jpeg'))
  ]
  headers = {
    'api_token': 'xxxx'
  }

  response = requests.request("POST", url, headers=headers, data=payload, files=files)

  print(response.text)
Request
header Parameters
api_token
required
string
Request Body schema: application/x-www-form-urlencoded
required
file
string <binary>

The file you would like to upload to Bria.

image_url
string

The URL of the file you would like to upload to Bria. The URL should lead to an image publicly available online. Either a file or an image_url should be provided. If both are provided, then the route will use image_url.

is_private
string
Default: true

The image can be included in the Bria public gallery (is_private=false) or only in the Bria gallery of your organization (is_private=true). This parameter is optional and the default value is true.

Responses
200

Successful operation.

206

File value was not provided.

208

File already uploaded.

400

Request doesn't contain file part.

405

Method not allowed.

413

Request entity too large.

415

Unsupported media type.

460

Failed to download image.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

post/upload
Request samples
Response samples
application/json
{
  • "visual_id": "string"
}

/register

Description

A new visual can be registered to Bria without being uploaded to the database using the Register Route. This route returns a visual identification to the user.

It's the first step for consuming the Bria API for new visuals (instead of using the /upload route).

Response

The visual id in the response of the Register Route must be kept by the user in order to query image info, modify the image and use the search routes.

{ "visual_id": "9ea9a4d2d19977a7c" }

The visual_id in the response of the /upload route will be used for all other routes. Store the visual_id in your database and map it to your image identification method for easy reference

Bria generative Web tool

The registered visual can be seen and used in the Bria generative web tool in cases where the tool is licensed as part of the project.

To do so, the user can access the following url: https://labs.bria.ai/gallery/{visual_id}, where the {visual_id} comes from the response of the /upload route.

Constraints

Files should not be larger than 12MB. The status code 413 will be returned if the file exceeds its maximum size.

The Bria API currently supports only JPEG and PNG files in RGB, RGBA, or CMYK color modes. When the file is of a different type or color mode, the status code 415 will be returned.

Request
header Parameters
api_token
required
string
Request Body schema: application/json
required
org_image_key
string

The internal image id in your API, of the image you would like to register to Bria. If accessing your images requires authentication, you will be able to register them using org_image_key only after giving Bria the API authentication information. It is also possible to register images using an org_image_key, without any authentication data.

image_url
string

The URL of the image you would like to register to Bria. The URL should lead to an image publicly available online. Either an org_image_key or an image_url should be provided. If both are provided, then the route will use image_url and org_image_key will be saved but not used. Images can only be registered using an image_url if they do not require authentication.

is_private
string
Default: true

The image can be included in the Bria public gallery (is_private=false) or only in the Bria gallery of your organization (is_private=true). This parameter is optional and the default value is true.

Responses
200

Successful operation.

208

Image already registered.

400

Bad request.

405

Method not allowed.

460

Failed to download image.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

post/register
Request samples
Response samples
application/json
{
  • "visual_id": "string"
}

/{visual_id}/remove_image

Description

With this route, you can remove an image from the gallery of your organization. The image won't be removed from Bria.

Request
path Parameters
visual_id
required
string
Example: b3cecc33cc31cc31
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

405

Method not allowed.

460

Failed to download image.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

post/{visual_id}/remove_image
Request samples

/{visual_id}/info

Description

The Info Route is used to retrieve useful information on a specific visual that was previously uploaded or registered.

Additionally, it provides the following:

  1. A description of each object and element within the scene

  2. The available changes, which are supported by the Bria API for each object and element

  3. The Oracle value for each available change. The orcale value predicts the quality of the result, for each possible action. The possible oracle values for object removal or background actions are true and false. The possible values for person modification are high, medium, and low.

Request
path Parameters
visual_id
required
string

visual id of the image, received after using the /upload or /register route.

Example: 8487fb411f3c6716
query Parameters
lean
boolean
Default: false

Set the value 'true' for this parameter if you wish to receive only the high-level information (currently, this means only the description, org_height, and org_width) from the info route. This parameter is optional and as default the value is 'false'.

header Parameters
api_token
required
string
Responses
200

Successful operation.

205

File hasn’t finished onboarding. Please call /info again until you get 200.

400

One of the details does not meet specification. Please call /info again.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

get/{visual_id}/info
Request samples
Response samples
application/json
{
  • "description": "Coming Soon",
  • "scene": [
    ]
}

Background

/{visual_id}/background/info

Description

The Background/Info Route is used to retrieve useful information on the background of a specific visual that was previously uploaded to the database.

Additionally, it provides the following:

  1. The available background actions, which are supported by the Bria API.

  2. The Oracle value for each available action. The orcale value predicts the quality of the result, for each possible action. The possible oracle values for background actions are true and false.

This route should be used instead of the main /info route when you are only interested in the available actions for the background of the image. With this route, you will save runtime by only obtaining information that is relevant to your needs.

Request
path Parameters
visual_id
required
string

visual id of the image, received after using the /upload or register route.

Example: f49943971e3039c7
header Parameters
api_token
required
string
Responses
200

Successful operation.

205

File hasn’t finished onboarding. Please call /info again until you get 200.

400

One of the details does not meet specification. Please call person/info again.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

get/{visual_id}/background/info
Request samples
Response samples
application/json
{
  • "id": "67a9746d4c7939e2753869cdb4330852b6e2472b8110ae1fb59f8c033fc7fe1f",
  • "type": "background",
  • "labels": null,
  • "rect": null,
  • "actions": {
    },
  • "oracle": {
    }
}

/background/remove

Description

The Remove BG Route can be used to remove the background of an image.

The main difference between the regular and this isolated background removal endpoint is that you can use this endpoint without uploading or registering the image to Bria.

Constraints

The Bria API currently supports only JPEG and PNG files in RGB, RGBA, or CMYK color modes. When the file is of a different type or color mode, the status code 415 will be returned.

Remove the background from an image using the image file

In our documentation request example, we demonstrate how to remove the background from an image using the image URL.

If you want to use an image from a file, follow the example below:

  import requests

  url = "https://engine.prod.bria-api.com/v1/background/remove"

  payload = {}
  files=[
    ('file',('image_name.jpeg',open('/path_to_local_file/image_name.jpeg','rb'),'image/jpeg'))
  ]
  headers = {
    'api_token': 'xxxx'
  }

  response = requests.request("POST", url, headers=headers, data=payload, files=files)

  print(response.text)
Request
header Parameters
api_token
required
string
Request Body schema: application/x-www-form-urlencoded
required
file
string <binary>

The image file you would like to remove the background from.

image_url
string

The URL of the image file you would like to remove the background from. The URL should lead to an image publicly available online. Either a file or an image_url should be provided. If both are provided, then the route will use image_url.

Responses
200

Successful operation.

206

File value was not provided.

400

Request doesn't contain file part.

405

Method not allowed.

415

Unsupported media type.

460

Failed to download image.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

post/background/remove
Request samples
Response samples
application/json
{
  • "result_url": "string"
}

/{visual_id}/background/remove

Description

The Remove BG Route is used to remove the background of a previously uploaded image.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

Before making any modifications, please call the /info or background/info route to obtain information on the available modifications, and their oracle values.

Request
path Parameters
visual_id
required
string

visual id of the image from which the user wishes to remove the background

Example: 8487fb411f3c6716
query Parameters
sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to modify the result of that route, please provide this information. This parameter is optional.

Example: sid=Remove this parameter if the image has not been modified using Bria.
desired_resolution
string

The desired resolution of the updated image. This parameter is optional.

Enum: "original" "nhd" "svga" "xga" "hd" "wuxga" "uwfhd" "wqxga" "uwqhd" "uhd"
Example: desired_resolution=original
original_quality
boolean

If you would like to retain the quality of the original image, please set this parameter to true. Enabling this parameter during background removal may cause longer response times, depending on the quality and size of the original image. This parameter is optional.

Example: original_quality=true
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

/{visual_id}/background/blur

Description

The background/blur Route is used to create a blur effect on the background of a previously uploaded image.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

Before making any modifications, please call the /info or background/info route to obtain information on the available modifications, and their oracle values.

Request
path Parameters
visual_id
required
string

visual id of the image for which the background should be blurred.

Example: 8487fb411f3c6716
query Parameters
scale
integer [ 1 .. 5 ]
Default: 5

A scale for determining how blurry the background of the image should be. The options are 1, 2, 3, 4, 5. This parameter is optional.

Example: scale=4
sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to modify the result of that route, please provide this information. This parameter is optional.

Example: sid=Remove this parameter if the image has not been modified using Bria.
desired_resolution
string

The desired resolution of the updated image. This parameter is optional.

Enum: "original" "nhd" "svga" "xga" "hd" "wuxga" "uwfhd" "wqxga" "uwqhd" "uhd"
Example: desired_resolution=original
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

/{visual_id}/replace_bg

Description

The Replace BG Route is used to replace the background of a previously uploaded image with a generated background using the state-of-the-art BRIA 2.3 ControlNet BG-Gen model (available on Hugging Face). This new version offers higher-quality backgrounds and more precise control compared to the previous BRIA 1.4-based model.

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

This endpoint also supports solid colors - you can take a color code and use it in the prompt. Before making any modifications, please call the /info or background/info route to obtain information on the available modifications, and their oracle values.

Here are some examples:

original image:

bg_prompt: a bottle in a living room interior, on a kitchen counter

placement_type: original

num_results:

results:

bg_prompt: in a living room interior, on a kitchen counter

You can use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

Request
path Parameters
visual_id
required
string

The visual id of the image for which the user wishes to replace the background

Example: b3cecc33cc31cc31
header Parameters
api_token
required
string
Request Body schema: application/json
sync
boolean
Default: false

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. Use polling for the URLs to retrieve images once ready.

sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to modify the result of that route, please provide this information. This parameter is optional.

desired_resolution
string

The desired resolution of the updated image. This parameter is optional.

Enum: "original" "nhd" "svga" "xga" "had" "wuxga" "uwfhd" "wqxga" "uwqhd" "uhd"
bg_prompt
string

Text from which you wish to generate the new background

refine_prompt
boolean
Default: false

It is recommended to set this parameter to 'True'. When true, an additional logic takes the bg_prompt that was included and adjusts it to achieve optimal results.

num_results
integer
Default: 4

The number of backgrounds you would like to generate for the image. If placement_type!=original, then for each selected placement you will get results in the amount specified in this parameter.

seed
integer

You can choose whether you want your generated results to be random or predictable. You can recreate the same result in the future by using the seed value of a result from the response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

negative_prompt
string

This parameter is optional.

Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

512

Insufficient resources to process the request.

post/{visual_id}/replace_bg
Request samples
Response samples
application/json
{
  • "result": [
    ]
}

Object

/{visual_id}/objects/info

Description

The Objects/Info Route is used to retrieve useful information on the objects in a specific visual that was previously uploaded to the database.

Additionally, it provides the following:

  1. The available object actions, which are supported by the Bria API.

  2. The Oracle value for each available action. The orcale value predicts the quality of the result, for each possible action. The possible oracle values for object actions are true and false.

This route should be used instead of the main /info route when you are only interested in information and available actions for the objects in the image. With this route, you will save runtime by only obtaining information that is relevant to your needs.

Request
path Parameters
visual_id
required
string

visual id of the image, received after using the /upload or register route.

Example: 92bf8ce17584de82
header Parameters
api_token
required
string
Responses
200

Successful operation.

205

File hasn’t finished onboarding. Please call /info again until you get 200.

400

One of the details does not meet specification. Please call objects/info again.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

get/{visual_id}/objects/info
Request samples
Response samples
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

/{visual_id}/objects/mask_generator

Description

The Objects/Mask Generator Route is used to generate all possible masks for an image.

The response contains a zip file named as the visual_id of the provided image.

There are k mask files in the zip, each named with the visual_id and mask_id.

The zip file contains an additional file whose name ends with "panoptic". It's not an image, it's a panoptic map. It can be transformed into a regular matrix.

Each point in the image (x,y) is mapped to the mask that applies to that point. In the panoptic map, each pixel's grayscale value includes the mask_id.

You can display those masks to the user, let them pick one or more masks, and use objects/remove route to remove the masked area.

In order to use the objects/remove route on the mask the user selected, you should provide the mask_id, and use the paramter mask_source=generated.

You can see below an example of the content of the zip:

  92bf8ce17584de82_panoptic.png

  
  92bf8ce17584de82_1.png

  
  92bf8ce17584de82_2.png

  
  92bf8ce17584de82_3.png

  
  ...

  
  92bf8ce17584de82_86.png

You can access the SDK that demonstrates how to use this endpoint in a UI in the following link.

Request
path Parameters
visual_id
required
string

visual id of the image, received after using the /upload or register route.

Example: 92bf8ce17584de82
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

post/{visual_id}/objects/mask_generator
Request samples

/{visual_id}/objects/remove

Description

The Remove Object Route is used to remove objects or areas.

You can provide the area for removal in the following methods:

  1. Call the /mask_generator endpoint, display the masks to the user, allow them to select a mask, and then send the mask_id to the objects/remove endpoint. Under the example named generated mask, you can see an example of this type of request.

  2. Allow the user to create a mask manually (by using a brush, for example), and then send the mask_url to the objects/remove endpoint. Under the example named manual mask, you can see an example of this type of request. You can access the SDK that demonstrates how to implement a brush feature in your Interface via the following link.

  3. Get the possible objects for removal using the /info or objects/info endpoint, present them to the user, and allow them to select objects for removal using the object name. Send the id of the selected object to the objects/remove endpoint. Under the example named object, you can see an example of this type of request.

In one request, you may send multiple IDs of objects, or points, or masks for removal, but you cannot combine them in one request. For example, you cannot send a point and a mask_id at the same time.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

Before making any modifications, please call the /info or objects/info route to obtain information on the available predefined objects in the image, the available modifications, and their Oracle values. If you are using mask_url or positive_points there is no need to call the info routes.

Request
path Parameters
visual_id
required
string

visual id of the image the user wants to remove objects from.

Example: 86f9986390596e8f
query Parameters
desired_resolution
string

The desired resolution of the updated image. This parameter is optional.

Enum: "original" "nhd" "svga" "xga" "had" "wuxga" "uwfhd" "wqxga" "uwqhd" "uhd"
Example: desired_resolution=original
original_quality
boolean

If you would like to retain the quality of the original image, please set this parameter to true. This parameter is optional. This parameter can also be used as a body parameter.

Example: original_quality=true
header Parameters
api_token
required
string
Request Body schema: application/json
sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to modify the result of that route, please provide this information. This parameter is optional.

enhance
boolean

Please use the value True in order to get the best result possible.

Array of objects

The requested changes to the image. In one request, you may send multiple IDs of objects, or points, or masks for removal, but you cannot combine them in one request. For example, you cannot send a point and a mask at the same time.

Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

/{visual_id}/caption

Description

The Caption Route is used to get a caption that describes the given image.

Request
path Parameters
visual_id
required
string

visual id of the image for which you'd like a caption

Example: 8487fb411f3c6716
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

get/{visual_id}/caption
Request samples
Response samples
application/json
{
  • "results": [
    ]
}

/search

Description

By using the Search Route, you can utilize Bria's generative search capabilities, which don't require labels or keywords.

The user can send any text query and receive relevant images that match the query.

The Search Route returns the images, sorted by the match score, from highest match to lowest match. The images are returned in batches, and you can specify how many images to receive in one batch, and which batch to receive in each call.

Request
query Parameters
query
string

the text query for which the user is looking for matching images.

Example: query=woman traveling in the world
num_results_per_page
integer

how many images you would like to receive from the gallery search. The default value is 50. The maximum value is 500. No need to use this parameter when gallery_search=false.

Example: num_results_per_page=1
page
integer

which batch of images you would like to receive in the current call. Synthetic results will only be included in page no. 1. The default value is 1. For each query, we support 800 results, so if you set num_results_per_page=50, you will have 16 pages of results.

Example: page=1
gallery_id
string

Bria will provide you with this parameter which represents your account's image gallery. You must include this parameter.

Example: gallery_id=425
style
string

Which style you would like to see in your results, this parameter is optional.

Enum: "stock photography" "photo realistic" "fashion" "retro" "sports" "still life" "hyper realistic" "travel" "artistic" "3d render" "realistic" "fantasy" "comic book" "minimalistic"
Example: style=photo realistic
atmosphere
string

Which atmosphere you would like to get in your results, this parameter is optional.

Enum: "dramatic" "vivid" "warm" "cool"
Example: atmosphere=dramatic
camera
string

Which camera angle you would like to see in your results, this parameter is optional.

Enum: "portrait" "close up" "aerial" "landscape"
Example: camera=portrait
medium
string

Which medium should be included in your results, this parameter is optional.

Enum: "photography" "art"
Example: medium=photography
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

get/search
Request samples
Response samples
application/json
{
  • "results": [
    ]
}

/search_similar_images

Description

By using the Search Similar Images Route, you can send an image as a query and receive relevant images that are similar.

The Search Similar Images Route returns the images, sorted by the similarity score, from the highest to the lowest.

The images are returned in batches, and you can specify how many images to receive in one batch, and which batch to receive in each call.

Request
query Parameters
vhash
string

the visual id of the image for which the user is looking for similar images.

Example: vhash=e01592ef1188df76
num_results_per_page
integer

how many images you would like to receive in the current call. The default value is 50. The maximum value is 500.

Example: num_results_per_page=1
page
integer

which batch of images you would like to receive in the current call. The default value is 1. For each query, we support 800 results, so if you set num_results_per_page=50, you will have 16 pages of results.

Example: page=1
gallery_id
string

Bria will provide you with this parameter which represents your account's image gallery. You must include this parameter.

Example: gallery_id=425
url
string

URL of an image, for which you would like to find similar images. When you want to search based on modified images, or images that have not been uploaded or registered to Bria, you can use this parameter. When this parameter is provided, the visual_id parameter can be None. The supported file types are jpg, jpeg and png, up to 12 mb.

Example: url=If you are using the vhash paramater, there is no need to use this parameter
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

get/search_similar_images
Request samples
Response samples
application/json
{
  • "results": [
    ]
}

AI-Presenter

/{visual_id}/person/info

Description

The Person/Info Route is used to retrieve useful information on the people in a specific visual that was previously uploaded to the database.

Additionally, it provides a description of each person within the scene along with its available changes, which are supported by the Bria API.

This route should be used instead of the main /info route when you are only interested in information and available actions for the people in the image. With this route, you will save time by only obtaining information that is relevant to your needs.

Request
path Parameters
visual_id
required
string

visual id of the image, received after using the /upload or register route.

Example: f49943971e3039c7
header Parameters
api_token
required
string
Responses
200

Successful operation.

205

File hasn’t finished onboarding. Please call /info again until you get 200.

400

One of the details does not meet specification. Please call person/info again.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

get/{visual_id}/person/info
Request samples
Response samples
application/json
[
  • {
    },
  • {
    }
]

/{visual_id}/create

Description

The Create Route is used to create a new visual, based on the changes requested by the user for a previously uploaded visual.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

Before making any modifications, please call the /info or person/info route to obtain information on the available presenters in the image, the available modifications, and their oracle values.

You should always include all the required changes in the request if you want to use multiple changes on a single person. It is not supported to make one request on a person with one change, take the SId from the result, and then use it in another request with a different change.

When you want to make changes on multiple people, you can make one request with all the desired changes on all the relevant people or make one request with all the desired changes on one person and then use the sid from the response in the request on the other person.

Request
path Parameters
visual_id
required
string

visual id of the image the user wants to create a new visual from.

Example: 8487fb411f3c6716
header Parameters
api_token
required
string
Request Body schema: application/json
sid
string

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to modify the result of that route, please provide this information. This parameter is optional.

desired_resolution
string

The desired resolution of the updated image. This parameter is optional.

Enum: "original" "nhd" "svga" "xga" "had" "wuxga" "uwfhd" "wqxga" "uwqhd" "uhd"
Array of objects

The requested changes to the original visual.

Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.

/{visual_id}/recast_model

Description

The Recast Model Route is used to create customized and eye-catching images of people that match various themes or professions by modifying their outfit, body structure, hair, and background.

This provides an easy and quick way to generate high-quality visuals for businesses, creative projects, or personal use without the need for extensive photography or design work.

The feature is also fun and engaging for social media or entertainment purposes, allowing users to create custom avatars or profile pictures that reflect their personality.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

Request
path Parameters
visual_id
required
string

visual id of the image the user wishes to customize.

Example: 8487fb411f3c6716
query Parameters
prompt
string

The profession or theme to which you would like to customize your image.

Example: prompt=superhero
header Parameters
api_token
required
string
Responses
200

Successful operation.

400

Bad request.

404

Specified Image does not exist.

405

Method not allowed.

500

Internal server error.

506

Insufficient data. The given input is not supported by the Bria API.