Endpoints that are part of BRIA API version 2.
Overview
Bria's Image Editing API equips builders with a comprehensive suite of tools for manipulating and enhancing images.
The API provides advanced capabilities including background operations (removal, replacement, blur), content manipulation (eraser, generative fill), image transformation (expansion, resolution increase), automatic cropping, person modification and automatic mask generation.
Asynchronous Requests and the Status Service
Bria API v2 endpoints process requests asynchronously by default. When you make an asynchronous request, the API immediately returns a request_id
and a status_url
instead of the final result. Use the Status Service to track the request's progress until it reaches a completed state.
See the full guide at Status Service Documentation for complete details and usage examples.
Advanced Customization and Access:
As part of Bria’s Source Code & Weights product, developers seeking deeper customization can access Bria’s source-available GenAI models via Hugging Face.
This allows full control over fine-tuning, pipeline creation, and integration into proprietary workflows—empowering AI teams to develop and optimize their own generative AI solutions.
https://engine.prod.bria-api.com/v2/image/edit/
https://engine.prod.bria-api.com/v1/
Request
Description
The Eraser Route enables the removal of elements or specific areas from a given image.
You can define the area to be removed by providing a mask that outlines the region to be erased. There are two main ways recommended to generate these masks:
Masks can be created by allowing users to draw directly on the image with a brush, for example. To access the SDK that demonstrates how to implement a brush feature in your interface, please refer to the following link.
By using the
/objects/mask_generator
route, which will generate all the possible masks for an image.
Output Characteristics
- The modified image is returned at the original resolution, preserving full visual quality without any automatic resizing or downscaling.
- All areas outside the provided mask remain completely unchanged, ensuring pixel-perfect preservation of unedited regions.
The source image to be handled by the API.
Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
The binary mask image that defines the region where object generation will occur.
Mask Requirements
- The region to generate content must have a pixel value of 255 (white).
- All other areas must have a pixel value of 0 (black).
- The mask must have the same aspect ratio as the input image.
Supported Input Types
- Base64-encoded string – provide the mask data directly in the request.
- URL – provide a publicly accessible URL to the mask image.
Accepted formats: JPEG, JPG, PNG, WEBP.
Ensure that any provided URL is publicly accessible at the time of the request.
Specifies how the input mask was created.
manual
(default) – Use when the mask was generated by a user, for example, using a brush tool.automatic
– Use when the mask was generated by an algorithm, such as SAM or other automated segmentation methods.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
https://engine.prod.bria-api.com/v2/image/edit/erase
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/erase \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example",
"mask": "example"
}'
{ "result": { "image_url": "string" }, "request_id": "string" }
Request
Description
The GenFill Route enables the generation of objects by prompt in a specific region of an image.
You can define the area for object generation by using a mask that outlines the region where the object will be created. Our model is optimized to work seamlessly with blob-shaped masks.
Masks can be created by allowing users to draw directly on the image with a brush, for example. To access the SDK that demonstrates how to implement a brush feature in your interface, please refer to the following link.
Output Characteristics
- The modified image is returned at the original resolution, preserving full visual quality without any automatic resizing or downscaling.
- All areas outside the provided mask remain completely unchanged, ensuring pixel-perfect preservation of unedited regions.
- If the input includes an alpha channel and
preserve_alpha=true
, the original transparency values (both full and partial) are maintained in the output.
Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Prompt Moderation – Validates the provided prompt and rejects requests containing unsafe or prohibited terms before processing starts.
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
The source image to be handled by the API.
Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
The binary mask image that defines the region where object generation will occur.
Mask Requirements
- The region to generate content must have a pixel value of 255 (white).
- All other areas must have a pixel value of 0 (black).
- The mask must have the same aspect ratio as the input image.
Supported Input Types
- Base64-encoded string – provide the mask data directly in the request.
- URL – provide a publicly accessible URL to the mask image.
Accepted formats: JPEG, JPG, PNG, WEBP.
Ensure that any provided URL is publicly accessible at the time of the request.
Specifies how the input mask was created.
manual
(default) – Use when the mask was generated by a user, for example, using a brush tool.automatic
– Use when the mask was generated by an algorithm, such as SAM or other automated segmentation methods.
The prompt you would like to use to generate the object within the masked region.
When enabled (default: true
), the input prompt is moderated before processing.
Expected Behavior
- The prompt is scanned for NSFW content and terms that violate Bria’s ethical guidelines.
- If the prompt fails moderation, the request is blocked and the API responds with a 422 error.
The prompt you would like to use to specify details or attributes to avoid in the object generated within the masked region.
Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.
- When true: The output image maintains the original transparency of fully and partially transparent pixels.
- When false: The output image is fully opaque.
- Has no effect if the input image does not include an alpha channel.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
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.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
https://engine.prod.bria-api.com/v2/image/edit/gen_fill
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/gen_fill \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example",
"mask": "example",
"prompt": "textual description"
}'
{ "result": { "image_url": "string", "seed": "string" }, "request_id": "string" }
Request
Description
The Remove BG Route can be used to remove the background of an image. This route leverages Bria's newest model, RMBG 2.0. For more details and to explore the model, check out the Hugging Face demo.
Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
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.
Transparency and Customizable Binarization
This endpoint returns an image where the background is removed, and the foreground remains with varying levels of transparency, allowing for smoother edges and more natural blending when placed over different backgrounds. Additionally, this unique output provides developers with the flexibility to binarize the result—transforming it into a binary mask—by setting a custom transparency threshold according to their specific use case. A binary mask is an image where pixels are either fully visible (foreground) or fully transparent (background), commonly used in visual generative AI and image processing pipelines. This capability enables seamless integration into workflows that require clear separation between subject and background, while still offering control over how strict this separation should be.
Below is a simple Python script to demonstrate how you can binarize the output image from the API. This allows you to set your own threshold to determine which areas are considered "foreground" and which are "background."
from PIL import Image
import numpy as np
# Load the image (the output from the API)
image = Image.open('output_image.png').convert('RGBA')
# Convert to numpy array
data = np.array(image)
# Define your threshold (0-255, where 255 is fully opaque)
threshold = 128
# Apply the threshold: if alpha > threshold, set to fully opaque (255), otherwise transparent (0)
data[:, :, 3] = np.where(data[:, :, 3] > threshold, 255, 0)
# Create a new Image from the modified array
binarized_image = Image.fromarray(data)
# Save or display
binarized_image.save('binarized_output.png')
binarized_image.show()
The image that you would like to remove the background from. Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
Controls whether partially transparent areas from the input image are retained in the output after background removal, if the input includes an alpha channel.
- When true: Partially transparent pixels preserve their original alpha values in the output.
- When false: All non-background areas in the output are rendered fully opaque.
- Has no effect if the input image does not include an alpha channel.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
https://engine.prod.bria-api.com/v2/image/edit/remove_background
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/remove_background \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example"
}'
{ "result": { "image_url": "string" }, "request_id": "string" }
Request
Description
The Replace BG Route is used to replace the background of any image.
We offer a fast version of this feature, powered by Bria 2.3 Fast LoRA (model card on Hugging Face), which provides an optimal balance between speed and quality.
This endpoint also allows replacing the background with a solid color of your choice. You can specify a hex color code (e.g., #FF5733) in the prompt to control the background color.
Here are some examples:
original image:

prompt: in a parking lot
result:

Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Prompt Moderation – Validates the provided prompt and rejects requests containing unsafe or prohibited terms before processing starts.
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
The image that you would like to remove the background from. Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
One or more reference images to guide the background generation.
Supported Input Types
- Base64-encoded string – provide the image data directly in the request.
- URL – provide a publicly accessible URL to the image.
- List – multiple images can be supplied as a list of Base64 strings or URLs.
Usage Constraints
- You must provide either
ref_images
orprompt
, but not both. - Accepted formats: JPEG, JPG, PNG, WEBP.
All provided images must be accessible and in a supported format at the time of processing.
When set to true, additional logic processes the included reference image to make adjustments for optimal results.
Text description of the new scene or background for the provided image. Either ref_images or prompt has to be provided but not both. Bria currently supports prompts in English only, excluding special characters.
When true, an additional logic takes the prompt that was included and adjusts it to achieve optimal results.
When enabled (default: true
), the input prompt is moderated before processing.
Expected Behavior
- The prompt is scanned for NSFW content and terms that violate Bria’s ethical guidelines.
- If the prompt fails moderation, the request is blocked and the API responds with a 422 error.
Elements or features that should be excluded from the generated scene. This parameter is optional and is available only when fast=false. Bria currently supports descriptions in English only.
When true, the output image retains the original input image's size; otherwise, the image is scaled to 1 megapixel (1MP) while preserving its aspect ratio.
When true
, forces background detection and removal, even if the original image already contains an alpha channel. Useful for refining existing foreground/background separation or ignoring unnecessary alpha channels.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
Determines the generation mode. When true, the generation will utilize the fast mode which provides the best balance between speed and quality. When false, the regular mode will be utilized.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
When enabled, applies content moderation to result visual.
Expected behavior:
- If the modified image fails moderation, returns a 422 error.
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.
https://engine.prod.bria-api.com/v2/image/edit/replace_background
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/replace_background \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example",
"prompt": "in a living room interior, on a kitchen counter"
}'
{ "result": { "image_url": "string", "seed": 0, "refined_prompt": "string" }, "request_id": "string" }
Request
Description
The Erase Foreground endpoint removes the primary subject (foreground) from the input image and intelligently generates the background to fill the erased area.
Output Characteristics
- Returns the edited image at its original resolution, ensuring full visual fidelity without any automatic resizing or downscaling.
- Only the foreground is removed; all other areas remain unaltered, preserving pixel-perfect accuracy in untouched regions.
- When
preserve_alpha=true
and the input image includes an alpha channel, the output maintains original transparency values (both full and partial).
Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
The image that you would like to remove the background from. Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.
- When true: The output image maintains the original transparency of fully and partially transparent pixels.
- When false: The output image is fully opaque.
- Has no effect if the input image does not include an alpha channel.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
https://engine.prod.bria-api.com/v2/image/edit/erase_foreground
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/erase_foreground \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image_url": "example"
}'
{ "result": { "image_url": "string" }, "request_id": "string" }
Request
Description
The background/blur Route is used to create a blur effect on the background of an image.
Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
The source image to be handled by the API.
Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
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.
Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.
- When true: The output image maintains the original transparency of fully and partially transparent pixels.
- When false: The output image is fully opaque.
- Has no effect if the input image does not include an alpha channel.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
https://engine.prod.bria-api.com/v2/image/edit/blur_background
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/blur_background \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example"
}'
{ "result": { "image_url": "string" }, "request_id": "string" }
Request
Description
The Image Expension Route can be used to expand an image, 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.
Alternatively, you can define a desired aspect_ratio, and the service will automatically place the input image in the center and expand the canvas to match that ratio.
In this way, you can create unique variations of your original image instead of cropping it into different aspect ratios and losing important details.
If aspect_ratio is not provided, both original_image_size and original_image_location must be specified.
Optimal input range
Input Image Area: Ensure that the ratio of the input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results.
Canvas Size: The canvas size should be up to an area of 5000x5000 pixels.
Prompt: This parameter is optional. If not provided or left empty, the service will automatically generate a prompt based on the input image.
Alpha Channel Handling
If the input image includes an alpha channel and
preserve_alpha=true
, newly generated pixels inherit the alpha values of the nearest original pixels along the same row or column, ensuring smooth transparency transitions.If the input image contains fully transparent pixels along any edge (top, bottom, left, or right), the request is rejected with a 422 error. Expansion is not supported in such cases to avoid undefined transparency behavior.
Here are some examples:
original image (Generated by Bria):

results:
original image (Stock Image):

results:
Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Prompt Moderation – Validates the provided prompt and rejects requests containing unsafe or prohibited terms before processing starts.
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
The source image to be handled by the API.
Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
Automatically expands or crops the input image to the specified aspect ratio.
Either aspect_ratio
or the combination of original_image_size
and original_image_location
must be provided.
When provided, canvas_size
, original_image_size
, and original_image_location
are ignored.
Centers the input image, expanding edges to reach the target ratio.
Accepts either:
- A predefined string: "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"
- A custom float between 0.5 and 3.0
If the target ratio equals the input image’s current ratio, no changes are made.
If the computed final dimensions exceed 5000×5000 px in total area, the input image is automatically resized so the area stays within limits.
Desired output canvas dimensions (width, height). Defaults to [1000, 1000] if not provided. Ignored when aspect_ratio
is used. Maximum allowed area is 25M pixels (i.e., width × height ≤ 5,000 × 5,000). Exceeding this returns a 400 error.
The desired size of the original image inside the final canvas, as [width, height]
in pixels. Ensure that the visible part of the input image (foreground or main subject) occupies more than 15% of the total canvas area for optimal results. This field is required when aspect_ratio
is not provided. Must be used together with original_image_location
.
The position of the top-left corner of the original image within the final canvas, provided as [x, y]
in pixels. This defines where the input image will be placed before expansion occurs. The values can be outside the canvas bounds—if so, the image will be cropped accordingly. Required when aspect_ratio
is not provided. Must be used together with original_image_size
.
Optional text prompt to guide the image expansion. If not provided or left empty, a prompt will be automatically generated as part of the service based on the input image. Currently, Bria supports prompts in English only and does not support special characters.
When enabled (default: true
), the input prompt is moderated before processing.
Expected Behavior
- The prompt is scanned for NSFW content and terms that violate Bria’s ethical guidelines.
- If the prompt fails moderation, the request is blocked and the API responds with a 422 error.
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.
This parameter is optional. Currently, Bria supports prompts in English only and does not support special characters.
Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.
- When true: The output image maintains the original transparency of fully and partially transparent pixels.
- When false: The output image is fully opaque.
- Has no effect if the input image does not include an alpha channel.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
https://engine.prod.bria-api.com/v2/image/edit/expand
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/expand \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example",
"aspect_ratio": "2:3"
}'
{ "result": { "image_url": "string", "seed": 0, "prompt": "string" }, "request_id": "string" }
Request
Description
The /enhance_image
endpoint improves the visual quality of an input image by generating richer details, sharper textures, and enhanced clarity. It also supports upscaling to higher resolutions and returns a refined version of the original visual.
Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
Unlike the Increase Resolution route, this endpoint regenerates the image to enhance visual richness while preserving essential details.
The source image to be handled by the API.
Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
When enabled, applies content moderation to result visual.
Expected behavior:
- If the modified image fails moderation, returns a 422 error.
Optional seed for controlling generation randomness. You can recreate the same result in the future by using the same seed with the same input parameters.
Number of enhancement steps. Higher values improve quality but increase processing time. Most quality gains occur within the first 20 steps.
Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.
- When true: The output image maintains the original transparency of fully and partially transparent pixels.
- When false: The output image is fully opaque.
- Has no effect if the input image does not include an alpha channel.
https://engine.prod.bria-api.com/v2/image/edit/enhance
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/enhance \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example",
"resolution": "2MP"
}'
{ "result": { "image_url": "string", "seed": "string" }, "request_id": "string" }
Request
Description
The Increase Resolution Route is used to upscale the resolution of any image.
Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
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.
Unlike the Enhance Image route, this endpoint does not add new details — it increases resolution using a dedicated upscaling method that preserves the original image content without regeneration.
The source image to be handled by the API.
Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.
- When true: The output image maintains the original transparency of fully and partially transparent pixels.
- When false: The output image is fully opaque.
- Has no effect if the input image does not include an alpha channel.
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.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
Note: When sync=true, the input image must not exceed 2 megapixels. Requests exceeding this limit will return a 422 error.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
https://engine.prod.bria-api.com/v2/image/edit/increase_resolution
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://engine.prod.bria-api.com/v2/image/edit/increase_resolution?desired_increase=2' \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example"
}'
{ "result": { "image_url": "string" }, "request_id": "string" }
Request
Description
The Crop Route is used to remove the background from an image and crop tightly around the foreground or remaining region of interest. It supports both images with and without a background.
Content Moderation
This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:
- Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
- Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
The source image to be handled by the API.
Supported input types:
- Base64-encoded string
- URL pointing to an image file that is publicly accessible and available at the time of processing.
Accepted formats: JPEG, JPG, PNG, WEBP.
Cropping the object with padding around it. Currently, padding is applied to all four borders of the remaining region. This parameter is optional.
When true
, forces background detection and removal, even if the original image already contains an alpha channel. Useful for refining existing foreground/background separation or ignoring unnecessary alpha channels.
Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.
- When true: The output image maintains the original transparency of fully and partially transparent pixels.
- When false: The transparency values from the input are not preserved, but the output may still include an alpha channel (e.g., around the cropped area).
- Has no effect if the input image does not include an alpha channel.
Specifies the response mode.
- When
false
(default), the request is processed asynchronously: the API immediately returns a status URL to track progress. - When
true
, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
When enabled, applies content moderation to input visual.
Expected behavior:
- Processing stops if the image fails moderation.
- Returns a 422 error with details about which parameter failed.
https://engine.prod.bria-api.com/v2/image/edit/crop_foreground
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://engine.prod.bria-api.com/v2/image/edit/crop_foreground \
-H 'Content-Type: application/json' \
-H 'api_token: string' \
-d '{
"image": "example"
}'
{ "result": { "image_url": "string" }, "request_id": "string" }