Skip to content

Bria Background Replace

POST/v1/run

Background Replace by Bria - AI-powered image editing, style transfer, and transformation. Edit photos with natural language instructions, remove backgrounds, change styles, and enhance images effortlessly.

Request body

Submit an async generation request. The model field selects the model; other fields are model-specific input parameters.

stringmodelrequired

Model identifier. Set to bria/background/replace.

Default: bria/background/replace

stringpromptrequired

The prompt you would like to use to generate images.

stringimagerequired

Input Image to erase from

Optional<boolean>fast

Whether to use the fast model

Default: true

Optional<string>ref_image_url

The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp.

Default:

Optional<boolean>refine_prompt

Whether to refine prompt

Default: true

Optional<integer>seed

The same seed and the same prompt given to the same version of the model will output the same image every time.

Range: 0 to 2147483647

Response Schema

The submit endpoint returns an accepted generation task. Poll the result endpoint with the returned id for terminal outputs or errors.

Optional<string>error

Error message if the task failed. Empty on success.

stringidrequired

Unique identifier for the generation task.

Optional<string>model

Model ID used for the prediction.

Optional<array>outputs

Array of generated content. Empty when status is not completed.

stringstatusrequired

Status of the task: pending, running, completed, failed, or timeout.

Allowed values: pending, running, completed, failed, timeout

Model capabilities

array<string>capability_tagsrequired

Capabilities declared by the model registry.

Default: image-to-image

stringexecution_moderequired

Execution mode declared by the model registry.

Default: async