The Bria API is designed to provide a comprehensive suite of tools for generating and customizing images. With Bria, you can:
Generate Images Using Bria Models: Utilize pre-trained Bria models to generate high-quality images based on text prompts.
Train Your Own Tailored Models: Create and manage custom-tailored models to generate images in specific styles or themes using your datasets.
Generate Vector Graphics (beta): Use the base and tailored models API endpoints to create versatile, editable vector graphics from text prompts.
Enhance Product Imagery with eCommerce Suite: Use specialized features to create professional product shots, packshots, and lifestyle images for eCommerce platforms.
Modify and Transform Images: Bring your own images and modify them using various routes to suit your needs.
This document provides an overview of the API's capabilities and guides users on how to effectively implement them.
Image Generation:
Use the /text-to-image
endpoints to generate any image you would like, based on the provided prompt, without needing to upload or register images first.
Utilize the /reimagine
endpoint to generate new images based on reference images, incorporating elements such as structure, composition, or style from existing visuals.
Enhance your prompts with the /prompt_enhancer
route or use the built-in prompt enhancement feature in /text-to-image routes to create more detailed and vivid descriptions, resulting in richer and more diverse image outputs.
Tailored Generation: The Tailored Generation API allows you to create and manage custom-tailored models for generating unique visual content based on your datasets. Tailored models can be trained using the API or through the Bria platform here.
Using the Tailored Generation API:
/datasets
endpoint to create a new dataset or retrieve existing datasets that belong to the client organization./datasets/{dataset_id}/images
endpoint to upload new images to a dataset or retrieve existing images that belong to the dataset./datasets/{dataset_id}/images/{image_id}
endpoint to get or delete a specific image from a dataset./models
endpoint to create a new model or retrieve all models that belong to the client organization./models/{id}
endpoint to retrieve a specific model by its ID or delete a specific model./models/{id}/start_training
endpoint to initiate the training process. Ensure that the dataset includes the minimum required number of images and has a status of 'completed' before starting training./models/{id}/stop_training
endpoint to stop a training job for a model.Training a Tailored Model:
/datasets
endpoint to create a dataset./datasets/{dataset_id}/images
endpoint./models
endpoint to create a model associated with your dataset./models/{id}/start_training
endpoint./text-to-image/tailored/{model_id}
route to generate images.Bria offers a variety of solutions for products and apps in the eCommerce industry, which allow to enhance product imagery for online stores and product catalogs. These solutions include:
/cutout
: Create clean and professional product cutouts.
/packshot
: Generate professional-standard packshots with customizable background colors and optimal product placement.
/shadow
: Add consistent and customizable shadow effects, supporting regular and floating shadows for product images with transparent backgrounds.
/lifestyle_shot_by_text
: Enrich product images by placing them in various environments using textual descriptions, enhancing appeal and providing context.
/lifestyle_shot_by_image
: Generate product images in enriched environments using a reference image for inspiration, allowing for creative and unique presentations.
Bria supports both isolated and registration-required routes for modifying images:
Isolated Routes (no registration required):
/increase_resolution
- Upscale any image.
/image_expansion
- Expand the image beyond its original borders.
/crop
- Crop an image tightly around the region of interest without a background.
/background/remove
- Remove the background of an image.
/background/blur
- Create a blur effect on the background.
/background/replace
- Generate new backgrounds for an image.
/erase_foreground
- Erase the foreground from a provided image.
/eraser
- Erase elements from an image using manually created or auto-generated masks.
/caption
- Generate a caption describing the given image.
Soon to be Isolated:
/mask_generator
- Retrieve all available masks for an image, creating a full segmenration of the image./image_to_psd
- Create a layered PSD file from any image.Uploading and Registering Images:
/register
endpoint to send a new image to Bria without being uploaded to the database. This is the recommended method to onboard images to Bria when needed.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./person/info
(soon to be deprecated) - By using the /person/info route, you can understand the possible changes for every people in the image. /person/modify
- Modify person-related elements in the image. In order to use this route you shuold first use the route /person/info./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.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: <...>' \
...
You can register and access the API Token through Bria's platform by clicking here.