v1

latestOpenAPI 3.0.02026-07-13650400.5 KB
Image Editing

Expand Image

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.

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

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. Here are some examples:

original image (Generated by Bria):

<img src="https://bria-image-repository.s3.amazonaws.com/images/caeaa19524d69ad6.jpg" width="200"/>

results:

<img src="https://bria-image-repository.s3.amazonaws.com/images/d4d49719b5a54e49.jpg" width="400"/> <img src="https://bria-image-repository.s3.amazonaws.com/images/cbf61f2b859662c0.jpg" width="200"/> <img src="https://bria-image-repository.s3.amazonaws.com/images/aa9b3036e5c6d43a.jpg" width="600"/>

original image (Stock Image):

<img src="https://bria-image-repository.s3.amazonaws.com/images/c64220ebda5ce787.jpg" width="200"/>

results:

<img src="https://bria-image-repository.s3.amazonaws.com/images/d35530e95ab7c509.jpg" width="400"/> <img src="https://bria-image-repository.s3.amazonaws.com/images/84752d2fca8a6ae3.jpg" width="200"/> <img src="https://bria-image-repository.s3.amazonaws.com/images/904f62b0dce4fb8c.jpg" width="600"/>

post/image_expansion

Headers

api_tokenstring required

Request body

image_urlstring

The URL of the input image. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB.

filestring

The file of the input image, in base64 format. Used if image_url is not provided. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB.

canvas_sizeinteger[]

The desired size of the final image, after the expansion. should have an area of less than 5000x5000 pixels.

original_image_sizeinteger[]

The desired size of the original image, inside the full canvas. Ensure that the ratio of input image foreground or main subject to the canvas area is greater than 15% to achieve optimal results.

original_image_locationinteger[]

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

promptstring

Text on which you wish to base the image expansion. This parameter is optional. Bria currently supports prompts in English only, excluding special characters.

seedinteger

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.

negative_promptstring

This parameter is optional. Bria currently supports prompts in English only.

Example request

{
  "image_url": "URL",
  "canvas_size": [
    1200,
    674
  ],
  "original_image_size": [
    610,
    855
  ],
  "original_image_location": [
    301,
    -66
  ]
}

Response

Successful operation.

codeinteger
descriptionstring
messagestring

A message that describes the request status. The options are Finished sucessfully, Content might not be safe for work.

promptstring

The prompt used to generate the expansion. If you want to recreate the result again, you should use in the request the prompt and the seed of the response.

result_urlstring

URL that represents the updated visual created in the request. It is a temporary URL that will expire

seedinteger

If you want to recreate the result again, you should use in the request the prompt and the seed of the response.

statusstring

The request status. The options are SUCCESS, NSFW.

Example response

{
  "code": 200,
  "description": "SUCCESS",
  "message": "Finished sucessfully",
  "prompt": "a man in a shirt sitting down in front of a brick wall looking off to the side",
  "result_url": "URL",
  "seed": 1525972691,
  "status": "SUCCESS"
}