Gå til innhold

Recraft 20b

Integrer

Modell-ID recraft-20b
# 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/recraft-20b?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"

Denne forespørselen: 0,022 $ 22 API-kreditter Kjør den på denne siden

Hent API-nøkkel
Recraft Tekst til bilde #image-generation#vector-art#typograph#style

Tekst-til-bilde-modell med mange valgbare stiler, blant annet vektor- og digital illustrasjon, samt fargehint

Recraft · Bilde

Det første resultatet ditt kommer her

Bygg en forespørsel nedenfor og kjør den med API-nøkkelen din. Utdata kopieres til lagringen vår, lagret for alltid eller 7 dager gratis.

Bygg en forespørsel

Kontrollene genereres fra modellskjemaet. Koden og prisen oppdateres når du endrer dem.

•obligatorisk 88 / 1000
image_size standard square_hd
standard realistic_image

Visuell stil som brukes på genererte bilder.

Avansert style_id · enable_safety_checker · colors

Valgfri identifikator for en egendefinert stilreferanse.

standard []

Matrise som inneholder foretrukne farger.

POST /run/recraft-20b?wait=20 pris → 0,022 $
# 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/recraft-20b?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"

Kjør denne forespørselen

Nøkkelen din blir i denne nettleseren: Den sendes bare til Doitong API og lagres bare i localStorage hvis du krysser av for Husk. Hent en API-nøkkel

Om Recraft 20b

Genererer bilder fra en prompt på opptil 1000 tegn. Parameteren `style` tilbyr en lang liste med alternativer innen realistiske bilder, digital illustrasjon og vektorillustrasjon, og `style_id` refererer til en egendefinert stil. En `colors`-matrise foreslår foretrukne farger, og `image_size` tilbyr forhåndsinnstillinger for kvadratisk, stående og liggende format.

Parametere

NavnType StandardTillatt Beskrivelse
promptobligatorisk
Typestring
≤ 1 000 tegn
image_sizevalgfritt
Typeobject
Standardsquare_hd
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
stylevalgfritt
Typeenum
Standardrealistic_image
anyrealistic_imagedigital_illustrationvector_illustrationrealistic_image/b_and_wrealistic_image/enterpriserealistic_image/hard_flashrealistic_image/hdrrealistic_image/motion_blurrealistic_image/natural_lightrealistic_image/studio_portraitdigital_illustration/2d_art_posterdigital_illustration/2d_art_poster_2digital_illustration/3ddigital_illustration/80sdigital_illustration/engraving_color
+21 fleredigital_illustration/glowdigital_illustration/graindigital_illustration/hand_drawndigital_illustration/hand_drawn_outlinedigital_illustration/handmade_3ddigital_illustration/infantile_sketchdigital_illustration/kawaiidigital_illustration/pixel_artdigital_illustration/psychedelicdigital_illustration/seamlessdigital_illustration/voxeldigital_illustration/watercolorvector_illustration/cartoonvector_illustration/doodle_line_artvector_illustration/engravingvector_illustration/flat_2vector_illustration/kawaiivector_illustration/line_artvector_illustration/line_circuitvector_illustration/linocutvector_illustration/seamless
Visuell stil som brukes på genererte bilder.
colorsvalgfritt
Typeobject[]
Standard[]
Matrise som inneholder foretrukne farger.
colors[].rvalgfritt
Typeinteger
Standard0
0 – 255
Verdien til den røde komponenten.
colors[].gvalgfritt
Typeinteger
Standard0
0 – 255
Verdien til den grønne komponenten.
colors[].bvalgfritt
Typeinteger
Standard0
0 – 255
Verdien til den blå komponenten.
style_idvalgfritt
Typestring | null
Valgfri identifikator for en egendefinert stilreferanse.
enable_safety_checkervalgfritt
Typeboolean
Standardfalse
Bryter for sikkerhetskontroll, der av-innstillingen krever kontogodkjenning. Uten denne godkjenningen kontrolleres hver forespørsel uavhengig av innstillingen; true aktiverer kontrollen.
obligatorisk

Utdata

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "recraft-20b",
  "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": 22,
    "usd": "0.022",
    "charged": 22,
    "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
      }
    ]
  },
  "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"
  }
}
Filene dine, ditt valgHver outputs[].url er en kopi på lagringen vår: lagret for alltid (betalt per GB-måned) eller 7 dager gratis, styrt av kontoinnstillingen din eller ?storage=.
Samme struktur for hver modelltype, url, content_type, width, height og duration, for bilder, video og lyd. output er modellens eget resultatobjekt.
Utdatafelt
images
array of object {url, content_type, file_name, file_size}

For AI-agenter: Denne siden som Markdown finnes på https://doitong.com/no/developers/models/recraft-20b.md. Alle modeller og veiledninger: https://doitong.com/developers/llms.txt