Breadcrumbs

Bria Connector v1.0 Initial Release

Version 1

Connector Overview: This page documents all 18 endpoints for the Briaconnector v1.


GET

Background/info: Get info and available actions for the background of the image

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 available changes for the background, which are supported by the Bria API.
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 time by only obtaining information that is relevant to your needs.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Response Type

N/A


GET

Blur_bg: Creates a blur effect on the background of an image

Description

The Blur BG 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.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Sid

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.

Response Type

N/A


GET

Caption: Get a caption that describes the image

Description

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Response Type

N/A


POST

Create: Create a new image based on changes requested by the user

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.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Sid

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.

Response Type

N/A


POST

Crop: Crop an image around the remaining region of interest.

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.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

visual id of the image the user would like to crop

Sid

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.

Response Type

N/A

Options (1)

Option Name

Description

Padding

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


POST

Image_to_psd: Create a layered PSD file from any image.

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.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Sid

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.

Response Type

N/A


GET

Increase_resolution: Increase image 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.

PNG files with transparency are not supported by this feature at the moment.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

visual id of the image the user would like to upscale

Sid

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.

Desired Increase

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

Response Type

N/A


GET

Info: Get image info and available actions

Description

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

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Lean

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'.

Response Type

N/A


GET

Objects/info: Get info and available actions for the objects in the image

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 a description of each object 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 objects in the image. With this route, you will save time by only obtaining information that is relevant to your needs.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Response Type

N/A


GET

Person/info: Get info and available actions for the people in the image

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.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Response Type

N/A


POST

Recast_model: Customize a portrait to any profession/theme

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.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

visual id of the image the user wishes to customize.

Prompt

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

Response Type

N/A


POST

Register: Register an image

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.

JSON
{ "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/tools/{visual_id}``, where the {visual_id} comes from the response of the /register route.

In Bria's web tool, the user has the ability to make many changes to the visual and also generate live videos, using an intuitive interactive platform.

Bria's web tool can also be embedded in other websites, with the use of an iframe HTML element:


Constraints

Bria API currently only supports JPEG and PNG files, which are not larger than 12MB.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (3)

Option Name

Description

Org Image Key

The internal image id in your API, of the image you would like to register to Bria (without uploading it). If your images require authentication, you will need to register them using org_image_key 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

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

Is Private

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.


GET

Remove_bg: Remove the background of an image

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.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Sid

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

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

Response Type

N/A


POST

Replace_bg: Replace the background of an image

Description

The Replace BG Route is used to replace the background of a previously uploaded image, with a generated background.
Additionally, you can change the canvas size of the final result as well as the positioning of the product or foreground. This will enable you to create new and unique variations of your original image.

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.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Response Type

N/A

Options (4)

Option Name

Description

Bg Prompt

Text from which you wish to generate the new background

Num Results

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

Seed

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.

Sid

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.


GET

Search: Search for images matching the given text query

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.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Query

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

Synchronous

Make sure this parameter is always set to true.

Gallery Search

Make sure this parameter is set to true if you wish to get search results from your gallery. The default value is true.

Num Results Per Page

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.

Synthetic Search

Make sure this parameter is set to true if you wish to get synthetic, generated results. The default value is false. With gallery_search=true and synthetic_search=true, you will get both types of results, and the first few will be synthetic.

Num Synthetic Results Per Page

how many synthetic images you would like to receive. The default value is 4. The maximum value is 4. No need to use this parameter when synthetic_search=false.

Page

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.

Gallery Id

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

Style

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

Atmosphere

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

Camera

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

Medium

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

Response Type

N/A


GET

Search_similar_images: Search for images matching the given image

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.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Num Results Per Page

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

Page

which batch of images you would like to receive in the current call. The default value is 1.

Gallery Id

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

Url

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.

Response Type

N/A


POST

Upload: Upload a file

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.

JSON
{ "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/tools/{visual_id}``, where the {visual_id} comes from the response of the /upload route.

In Bria's web tool, the user has the ability to make many changes to the visual and also generate live videos, using an intuitive interactive platform.

Bria's web tool can also be embedded in other websites, with the use of an iframe HTML element:


Constraints

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

Bria API currently only supports JPEG and PNG files. The status code 415 will be returned if the file is of a different type.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (3)

Option Name

Description

File

The file you would like to upload to Bria.

Image Url

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

Is Private

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.


POST

Video (Coming Soon): Generate a video from a still image

Description

The Video Route is used to create a new video, based on a previously uploaded single still image.

This route can also be used on an image that has been changed by the user using the /create route.

The Video Route will return the URL for accessing the new generated video and the confidence that Bria has in the quality of this video.

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Visual Id

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

Response Type

N/A