Bria Enhance Image Serverless API

Bria AI creates precise, high-quality image enhancements and manipulations for diverse creative applications.

~35.83s
POST /v2/bria-enhance-image · submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3import segmind
 4
 5# Async (v2): submit to the queue and block until COMPLETED.
 6# run() returns the final result dict (600s deadline, 1.0s poll by default).
 7result = segmind.run(
 8    "bria-enhance-image",
 9    image="https://segmind-resources.s3.amazonaws.com/input/a53c2a29-1e2c-473b-ad5a-2dfdb1184dfa-e8a1673f-7919-463e-b6fb-e12ad39140f1.jpeg",
10    visual_input_content_moderation=True,
11    visual_output_content_moderation=True,
12    seed=123456,
13    steps_num=30,
14    resolution="4MP",
15    preserve_alpha=True,
16)
17print(result["status"])                      # COMPLETED
18print(result.get("output"))                  # model output (e.g. media URL)
19print(result["metrics"]["inference_time"])   # server compute seconds
20
21# --- Or submit + poll manually (track request_id, control the cadence) ---
22from segmind import SegmindClient, InferenceFailed, InferenceTimeout
23
24client = SegmindClient()                      # reads SEGMIND_API_KEY
25payload = {
26    "image": "https://segmind-resources.s3.amazonaws.com/input/a53c2a29-1e2c-473b-ad5a-2dfdb1184dfa-e8a1673f-7919-463e-b6fb-e12ad39140f1.jpeg",
27    "visual_input_content_moderation": True,
28    "visual_output_content_moderation": True,
29    "seed": 123456,
30    "steps_num": 30,
31    "resolution": "4MP",
32    "preserve_alpha": True,
33}
34job = client.submit_async("bria-enhance-image", **payload)
35print(job.request_id)                         # available immediately
36try:
37    result = job.wait(timeout=600, interval=1.0)
38except InferenceTimeout as e:
39    print("still running:", e.request_id)
40except InferenceFailed as e:
41    print("failed:", e.detail)

API Endpoint

POSThttps://api.segmind.com/v1/bria-enhance-image

Parameters

imagerequired
string (uri)

Provides the URL of the source image. Use a valid URI for best results.

preserve_alphaoptional
boolean

Retains alpha channel from input to output. Use true for transparency.

Default: true
resolutionoptional
string

Selects output image resolution. Choose based on display or quality needs.

Default: "4MP"
Allowed values :
"1MP""2MP""4MP"
seedoptional
integer

Sets result predictability. Use the same seed for repeatable results.

Default: 123456Range: 1 - 999999
steps_numoptional
integer

Defines the number of refinement iterations. Higher numbers provide more detail.

Default: 30Range: 10 - 50
visual_input_content_moderationoptional
boolean

Applies moderation to input. Enable for sensitive content.

Default: true
visual_output_content_moderationoptional
boolean

Moderates output content for safety. Enable to filter results.

Default: true

Response Type

Returns: Image

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/bria-enhance-image

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 — the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out