Bria Fibo 2.0 Edit API Documentation

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 4 source 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 21 supported aspect ratios or keep the first image’s ratio.
  • PNG and JPEG output — Select the output format that fits your workflow.

Parameters

ParameterRequiredDescription
imagesYesBetween 1 and 4 source or reference images. Supports JPEG, JPG, PNG, and WEBP.
promptConditionalText instructions describing the desired edit. Required unless structured_instruction is provided. Do not use both.
mask_imageNoBlack-and-white mask for single-image editing. White areas are edited and black areas are preserved.
structured_instructionNoAdvanced edit instructions as a JSON string, used instead of prompt.
aspect_ratioNoOutput 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_formatNoOutput format: png or jpeg. Default: png.
seedNoOptional seed. Omit for random generation.

How to Use

  1. Upload images — Provide between 1 and 4 source or reference images.
  2. Describe the edit — Use prompt or provide a structured_instruction.
  3. Add a mask optional — For a single-image edit, use a mask to define the area that should change.
  4. Choose framing optional — Select an aspect ratio or keep the first image’s ratio.
  5. Choose output format optional — Select png or jpeg.
  6. 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

  • images is required and supports 1–4 images.
  • Provide either prompt or structured_instruction, not both.
  • mask_image requires 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_ratio is 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_ratio is specified. Large aspect-ratio changes may also reduce quality.
  • Multi-reference edits support all listed aspect ratios.

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
done

Retry temporary errors only while polling, never the submit request. Errors, retries and timeouts

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
imagesarray<string>Yes-1 ~ 4 items · each item: 1 ~ unlimited charactersOne to four source/reference images. Supported formats: JPEG, JPG, PNG, WEBP.
promptstringNo1 ~ unlimited characters · pattern: \SDescribe the changes to make. Required unless structured_instruction is supplied.
mask_imagestringNo1 ~ unlimited characters · pattern: \SOptional black-and-white mask for one source image only. White areas are edited; black areas are preserved. Must match the source dimensions.
structured_instructionstringNo-1 ~ unlimited characters · pattern: \SAdvanced option. Advanced edit instructions as a JSON string. Use instead of prompt.
aspect_ratiostringNo-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:5Output 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_formatstringNopngpng, jpegOutput image format.
seedintegerNo--Random seed. Leave empty for a random result.

Conditional constraints

  • Not allowed: prompt has at most 0 characters or omitted and structured_instruction has at most 0 characters or omitted.
  • prompt and structured_instruction cannot be used together.
  • Not allowed: images has at least 2 items or omitted and mask_image is provided.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.statusstringTask status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses.
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<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.urlsobjectObject containing related API endpoints
data.statusstringStatus: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.