Actions23
- Add Object by Text
- Blend Images
- Blur Background
- Colorize
- Crop out Foreground
- Enhance Image
- Erase (Mask-based)
- Erase Foreground
- Erase Object by Text
- Expand Image (Outpainting)
- Generate Structured Instruction
- Generative Fill
- Image Edit by Text (FIBO)
- Increase Resolution (Upscaling)
- Relight Image
- Remove Background
- Replace Background
- Replace Object by Text
- Reseason Image
- Restore Old Images
- Restyle Image
- Rewrite (Text in Image)
- Sketch to Image
Restyle Image
AI-generatedSummary
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.