- Upscale Exact
Description
The Upscale Exact Route enlarges an image to upscale_factor times its size on each side, anywhere from 1x to 4x, decimals included, with Bria's FIBO 2 upscaler.
Instead of stretching pixels, a FIBO 2 model trained for upscaling redraws the image at the new size, rebuilding edges, textures and fine detail. The result is then matched back to the source's colors and cleaned of grain, so it stays faithful to the original. See What's new: Bria Upscale Exact for examples.
Asynchronous
This endpoint is asynchronous only. It returns 202 Accepted with a status_url right away; get the result from the status endpoint or a webhook. When the job is done, result holds image_url and the seed it used. A small image takes about 10 seconds, and a 16 MP image about a minute.
Size Limits
- Each side of the input must be at least 256 px, and the input at most 16,777,216 px in total (16.8 MP, such as 4096 x 4096).
- The result,
upscale_factortimes each side, can be at most 70,000,000 px.
A request outside these limits returns 400 Resolution not supported, with the limit in details, before any processing starts.
Transparency
With preserve_alpha (the default), the input's alpha channel comes back resized to the result, as a PNG. A JPEG has no transparency, so output_type: jpeg leaves it out.
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 supports JPEG, PNG and WEBP 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.
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. Each side must be at least 256 px, and the image at most 16,777,216 px in total.
How many times larger each side gets, as a float from 1 to 4, such as 2.5. 2 doubles the width and height. The result can be at most 70,000,000 px.
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, resized to the result.
- When false: The output image is fully opaque.
- Has no effect if the input image does not include an alpha channel, or with
output_type: jpeg.
The result's format. A JPEG is several times smaller than the PNG but has no transparency.
Seeds the upscale. When omitted, a random seed is used; the result returns the seed it used.
Optional URL for receiving the result via webhook when the async job completes. See webhooks.
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.
from bria_client import BriaSyncClient
client = BriaSyncClient() # reads BRIA_API_TOKEN
job = client.submit(
endpoint="image/upscale/exact",
payload={
"image": "https://labs-assets.bria.ai/sandbox-example-inputs/enhance_image_example.jpg",
"upscale_factor": 2.5,
},
)
result = client.poll(job, interval=3, timeout=600)
print(result.result.image_url)Accepted (Asynchronous). You can track the progress and retrieve the final result using the status endpoint. For more details, refer to the status endpoint section.
{ "request_id": "string", "status_url": "string" }