Ruka hadi kwenye maudhui

Replace Background

Unganisha

Kitambulisho cha modeli bria/replace-background
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/bria/replace-background?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Ombi hili: $ 0.04 salio za API 40 Iendeshe kwenye ukurasa huu

Pata ufunguo wa API
Bria AI · Picha

Tokeo lako la kwanza linaonekana hapa

Unda ombi hapa chini na uliendeshe kwa ufunguo wako wa API. Matokeo yanakiliwa kwenye hifadhi yetu, yakihifadhiwa milele au 7 siku bila malipo.

Unda ombi

Vidhibiti vinazalishwa kutoka kwenye schema ya modeli. Msimbo na bei husasishwa unapovibadilisha.

Kidokezo kinachoeleza mandharinyuma ya kubadilisha.

Ya kina negative_prompt · steps_num · seed
chaguomsingi

Kidokezo hasi kinachobainisha cha kutenga kwenye mandharinyuma ya kubadilisha.

chaguomsingi 30

Jumla ya idadi ya hatua za inference.

chaguomsingi 4925634

Seed inayodhibiti ubahatishaji kwa matokeo yanayoweza kurudiwa.

POST /run/bria/replace-background?wait=20 makadirio → $ 0.04
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/bria/replace-background?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Endesha ombi hili

Key yako inabaki kwenye kivinjari hiki: inatumwa kwa Doitong API pekee na kuhifadhiwa (localStorage) tu ukiweka tiki kwenye Kumbuka. Pata ufunguo wa API

Kuhusu Replace Background

Huzalisha mandharinyuma mpya ya picha ya bidhaa kulingana na `prompt`, ikilenga mwanga na mtazamo halisi. Chaguo ni `negative_prompt`, `steps_num` (chaguomsingi 30) na `seed` kwa matokeo yanayoweza kuzalishwa tena. Hurudisha picha iliyozalishwa, pamoja na safu ya picha.

Vigezo

JinaAina ChaguomsingiInaruhusiwa Maelezo
promptsi lazima
Ainastring | null
Kidokezo kinachoeleza mandharinyuma ya kubadilisha.
seedsi lazima
Ainainteger
Chaguomsingi4925634
Seed inayodhibiti ubahatishaji kwa matokeo yanayoweza kurudiwa.
steps_numsi lazima
Ainainteger
Chaguomsingi30
Jumla ya idadi ya hatua za inference.
negative_promptsi lazima
Ainastring
Chaguomsingi
Kidokezo hasi kinachobainisha cha kutenga kwenye mandharinyuma ya kubadilisha.
inahitajika

Tokeo

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "bria/replace-background",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 40,
    "usd": "0.04",
    "charged": 40,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "image": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768
    },
    "images": [
      {}
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Faili zako, chaguo lakoKila outputs[].url ni nakala kwenye hifadhi yetu: huhifadhiwa milele (hutozwa kwa GB kwa mwezi) au 7 siku bila malipo, kulingana na mpangilio wa akaunti yako au ?storage=.
Muundo uleule kwenye kila modelitype, url, content_type, width, height na duration, kwa picha, video na sauti. output ni kitu cha matokeo cha modeli yenyewe.
Sehemu za tokeo
image
object {url, content_type, file_name, file_size, width, height}Picha iliyozalishwa na modeli.
images
array of objectPicha zilizozalishwa.

Miundo zaidi: Uhariri wa Picha

Kwa mawakala wa AI: ukurasa huu katika Markdown unapatikana kwenye https://doitong.com/sw/developers/models/bria/replace-background.md. Modeli na miongozo yote: https://doitong.com/developers/llms.txt