Bria Fibo 2.0 Edit API Documentation
Playground
Try it on WaveSpeedAI!Bria FIBO 2.0 Image Edit edits one to four reference images with natural-language or structured instructions, supporting masked single-image edits, visual refinements, product visuals, marketing assets, creative content, and production workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Bria FIBO 2.0 Edit transforms existing images with natural-language instructions. Edit a single image, combine multiple references, or use a mask to focus changes on a specific area.
Why Choose This?
- Text-guided editing — Describe changes to subjects, scenes, colors, lighting, and visual style.
- Multi-reference support — Use up to
4source or reference images in one request. - Localized editing — Use a black-and-white mask to control where changes are applied.
- Structured instructions — Use structured edit instructions instead of a standard text prompt.
- Flexible framing — Choose from
21supported aspect ratios or keep the first image’s ratio. - PNG and JPEG output — Select the output format that fits your workflow.
Parameters
| Parameter | Required | Description |
|---|---|---|
| images | Yes | Between 1 and 4 source or reference images. Supports JPEG, JPG, PNG, and WEBP. |
| prompt | Conditional | Text instructions describing the desired edit. Required unless structured_instruction is provided. Do not use both. |
| mask_image | No | Black-and-white mask for single-image editing. White areas are edited and black areas are preserved. |
| structured_instruction | No | Advanced edit instructions as a JSON string, used instead of prompt. |
| aspect_ratio | No | Output aspect ratio: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 16:10, 10:16, 2:1, 1:2, 21:9, 9:21, 3:1, 1:3, 4:1, 1:4, 5:1, or 1:5. Defaults to the first image’s ratio when omitted. |
| output_format | No | Output format: png or jpeg. Default: png. |
| seed | No | Optional seed. Omit for random generation. |
How to Use
- Upload images — Provide between
1and4source or reference images. - Describe the edit — Use
promptor provide astructured_instruction. - Add a mask optional — For a single-image edit, use a mask to define the area that should change.
- Choose framing optional — Select an aspect ratio or keep the first image’s ratio.
- Choose output format optional — Select
pngorjpeg. - Submit — Generate and retrieve the edited image.
Pricing
$0.04 per request.
Best Use Cases
- Product image editing — Change backgrounds, colors, materials, and presentation.
- Creative compositing — Combine multiple visual references into a new image.
- Localized edits — Modify selected areas while preserving the rest of the image.
- Advertising creatives — Adapt existing assets for campaigns and promotions.
- Scene transformation — Change environments, lighting, styling, or visual direction.
- Multi-reference workflows — Use several images to guide the final composition.
Pro Tips
- Clearly describe what should change and what should remain unchanged.
- Use a mask when the edit needs to stay within a specific area.
- Use multiple references when combining subjects, products, or visual elements.
- Keep large aspect-ratio changes limited when editing a single image.
- Use a fixed seed when comparing prompt or parameter changes.
Notes
imagesis required and supports1–4images.- Provide either
promptorstructured_instruction, not both. mask_imagerequires exactly one input image.- The mask must match the source image’s pixel dimensions.
- White mask areas are edited; black areas are preserved.
- Multi-reference edits cannot be combined with a mask.
- If
aspect_ratiois omitted, the first image’s ratio is used. - For single-image edits, the output may retain the source aspect ratio even when a different
aspect_ratiois specified. Large aspect-ratio changes may also reduce quality. - Multi-reference edits support all listed aspect ratios.
Related Models
- Bria FIBO 2.0 Text-to-Image — Generate images from text, reference images, or structured prompts.
- Bria FIBO 2.0 Edit — Edit and combine existing images with text or structured instructions.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
set -euo pipefail
export WAVESPEED_API_KEY="your-api-key"
REQUEST_BODY=$(cat <<'JSON'
{
"images": [
"https://interactive-examples.mdn.mozilla.net/media/cc0-images/painted-hand-298-332.jpg"
],
"aspect_ratio": "1:1",
"output_format": "png",
"prompt": "A cinematic ocean wave at sunrise, highly detailed"
}
JSON
)
# 1. Submit the prediction once. Never retry this request automatically:
# a retry after an unclear failure can create a second, billed task.
CHECK='The task may already exist. Check History or the predictions list before submitting again.'
if ! SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--connect-timeout 10 --max-time 60 \
-X POST "https://api.wavespeed.ai/api/v3/bria/fibo-2.0/edit" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
-H "Content-Type: application/json" \
-d "${REQUEST_BODY}"); then
printf 'Submit failed. %s\n' "${CHECK}" >&2
exit 1
fi
TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
printf 'Submission response did not contain a prediction id. %s\n' "${CHECK}" >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"
# 2. Poll until the prediction reaches a final status.
BODY_FILE=$(mktemp)
trap 'rm -f "${BODY_FILE}"' EXIT
while true; do
# Transient errors (429, 5xx) are retried, honoring Retry-After.
HTTP_CODE=$(curl --silent --show-error --fail-with-body \
--connect-timeout 10 --max-time 60 --retry 5 --retry-delay 2 \
--output "${BODY_FILE}" --write-out '%{http_code}' \
"${RESULT_URL}" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" || true)
case "${HTTP_CODE}" in
2??) ;;
000|429|5??) # dropped connection or temporary error: keep polling
printf 'Task %s: HTTP %s, polling again in 10s\n' "${PREDICTION_ID}" "${HTTP_CODE}" >&2
sleep 10; continue ;;
*) printf 'Task %s: HTTP %s\n' "${PREDICTION_ID}" "${HTTP_CODE}" >&2
cat "${BODY_FILE}" >&2; exit 1 ;;
esac
RESULT=$(jq 'if type == "object" and has("data") then .data else . end' "${BODY_FILE}")
STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')
case "${STATUS}" in
completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted)
printf 'Task %s ended with status %s\n' "${PREDICTION_ID}" "${STATUS}" >&2
printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneRetry temporary errors only while polling, never the submit request. Errors, retries and timeouts
Parameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| images | array<string> | Yes | - | 1 ~ 4 items · each item: 1 ~ unlimited characters | One to four source/reference images. Supported formats: JPEG, JPG, PNG, WEBP. |
| prompt | string | No | 1 ~ unlimited characters · pattern: \S | Describe the changes to make. Required unless structured_instruction is supplied. | |
| mask_image | string | No | 1 ~ unlimited characters · pattern: \S | Optional black-and-white mask for one source image only. White areas are edited; black areas are preserved. Must match the source dimensions. | |
| structured_instruction | string | No | - | 1 ~ unlimited characters · pattern: \S | Advanced option. Advanced edit instructions as a JSON string. Use instead of prompt. |
| aspect_ratio | string | No | - | 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 16:10, 10:16, 2:1, 1:2, 21:9, 9:21, 3:1, 1:3, 4:1, 1:4, 5:1, 1:5 | Output aspect ratio. Leave empty to use the first image's aspect ratio. Single-image edits may lose quality with large ratio changes; multi-reference edits fully support all listed ratios. |
| output_format | string | No | png | png, jpeg | Output image format. |
| seed | integer | No | - | - | Random seed. Leave empty for a random result. |
Conditional constraints
- Not allowed:
prompthas at most 0 characters or omitted andstructured_instructionhas at most 0 characters or omitted. promptandstructured_instructioncannot be used together.- Not allowed:
imageshas at least 2 items or omitted andmask_imageis provided.
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Task status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses. |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<string | object> | Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model. |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Status: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |