Bria AI Edit & Auto Download

Autonomously executes Bria AI operations, polls the status, and downloads the generated image

Restyle Image

AI-generated

Summary

Restyle an input image via Bria AI's /v2/image/edit/restyle endpoint, poll the returned status URL until generation completes, and return the resulting image and API response metadata.

Inputs

  • imageUrl (required) — The URL of the image. Alternatively, a base64 encoded string.
  • instruction (required) — The text prompt, instruction, color, season, or style to apply (mapped to the 'style' parameter for restyle).
  • maxRetries — Maximum number of times to poll the status URL. Default: 30.
  • waitTime — Time to wait between polling attempts in milliseconds. Default: 3000.

Output shape

Each returned item contains a 'json' field with the final API response object, and a 'binary' field with the generated image data (image/png) when operation is not 'structured_instruction'.

If generation does not complete within maxRetries, an error is thrown. If the response lacks a status_url initially, the operation also fails.

Examples

Example 1: Successful restyle with default retries and wait time.

Uses imageUrl and instruction; polls up to 30 times with 3s intervals; returns JSON response and downloaded image binary.

Links

Discussion