Saltar al cuntegna

Phota Text to Image

Integrar

ID dal model phota
# 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/phota?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"

Questa dumonda: $0,09 90 credits API Lantschar sin questa pagina

Obtegna ina clav API
Open model Text a maletg Output 4Kfin a 4K #stylized#transform#typography#phota

Text-to-image cun model da basa tschernibel e sustegn per profils d'identitad trenads en il prompt

Open model · Maletg

Tes emprim resultat vegn qua

Construis ina dumonda sutvart e l'exequescha cun tia clav API. Outputs vegnan copiads en nossa memorisaziun, conservads per adina u 7 dis gratuitamain.

Construir ina dumonda

Ils controls vegnan generads dal schema dal model. Il code e ​​il pretsch s'actualiseschan durant che ti als midas.

•obligatori

Prompt per la generaziun dal maletg, nua che profilst specificAs pon vegnir referenziads cun [[profile_id_1]], [[profile_id_2]], e.u.v.; descriva il maletg che ti vuls crear.

resolution standard 1K

Resoluziun da duvrar per il maletg generà.

aspect_ratio standard auto

Relaziun larghezza-altezza dal maletg d'output.

num_images standard 1

Dumber da maletgs da producir.

Avanzà output_format · base_model · enable_safety_checker
output_format standard jpeg

Format da datoteca dal maletg final.

base_model standard nb2

Selecziun dal model da renderisaziun, cun `4K` disponibel mo tras `nb2`. Ils identity layers vegnan surpostads sur mintga model da basa tschernì, uschia che mintga tscherna è cumpatibla cun profilst trenads.

POST /run/phota?wait=20 calculaziun → $0,09
# 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/phota?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"

Executar questa dumonda

Tia clav resta en quest browser: ella vegn tramessa mo al Doitong API e memorisada (localStorage) mo sch'ella scheccas Tiar a memoria. Obtegnair ina clav API

Davart Phota Text to Image

Generescha fotografias a partir d'in prompt e po far referenza a profils trenads en il text dal prompt sco [[profile_id_1]] e.u.v. `base_model` tscherna il renderer: nb2, qwen-image-2, flux-2 u seedream-5-pro. `resolution` è 1K u 4K, cun 4K mo sin nb2. Las proporziuns èn auto, 1:1, 16:9, 4:3, 3:4 u 9:16, e per mintga clamada vegnan restituids 1 fin 4 maletgs.

Parameters

Invia u il num canonic u il num nativ, betg omaduas. Nums canonics

NumTip StandardPermess Descripziun
promptobligatori
Tipstring
Prompt per la generaziun dal maletg, nua che profilst specificAs pon vegnir referenziads cun [[profile_id_1]], [[profile_id_2]], e.u.v.; descriva il maletg che ti vuls crear.
num_imagesopziunal num_outputs
Tipinteger
Standard1
1 – 4
Dumber da maletgs da producir.
output_formatopziunal
Tipenum
Standardjpeg
jpegpng
Format da datoteca dal maletg final.
resolutionopziunal
Tipenum
Standard1K
1K4K
Resoluziun da duvrar per il maletg generà.
aspect_ratioopziunal
Tipenum
Standardauto
auto1:116:94:33:49:16
Relaziun larghezza-altezza dal maletg d'output.
base_modelopziunal
Tipenum
Standardnb2
nb2qwen-image-2flux-2seedream-5-pro
Selecziun dal model da renderisaziun, cun `4K` disponibel mo tras `nb2`. Ils identity layers vegnan surpostads sur mintga model da basa tschernì, uschia che mintga tscherna è cumpatibla cun profilst trenads.
enable_safety_checkeropziunal
Tipboolean
Standardtrue
La controlla po vegnir schluccada cun definir false, premess che l'appelant saja autorisà.
obligatori Num canonic, er acceptà

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "phota",
  "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": 90,
    "usd": "0.09",
    "charged": 90,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "images": [
      {
        "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
      }
    ]
  },
  "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"
  }
}
Tias datotecas, tia decisiunMintga outputs[].url è ina copia en nossa memorisaziun: conservada per adina (pajà per GB-mes) u 7 dis gratuitamain, tenor la configuraziun dal conto u ?storage=.
La medema structura per mintga modeltype, url, content_type, width, height e duration, tant per maletgs sco per video e audio. output è l'object da resultat dal model sez.
Champs da l'output
images
array of object {url, content_type, file_name, file_size, width, height}URL che mussa al maletg generà.

Dapli models: Text a maletg

Per agents AI: questa pagina sco Markdown è disponibla sut https://doitong.com/rm/developers/models/phota.md. Tut ils models e las guidas: https://doitong.com/developers/llms.txt