POST
/
realtime
/
text2img
Generate image from text prompt (Real-Time)
curl --request POST \
  --url https://modelslab.com/api/v6/realtime/text2img \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "width": 512,
  "height": 512,
  "samples": 1,
  "safety_checker": false,
  "seed": 123,
  "instant_response": false,
  "base64": false,
  "webhook": "<string>",
  "track_id": "<string>"
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "meta": {},
  "nsfw_content_detected": true
}
Text to image endpoint result
This API currently supports the following image formats: PNG and JPG.

Request

Make a POST request to below endpoint and pass the required parameters as a request body.
curl
--request POST 'https://modelslab.com/api/v6/realtime/text2img' \

Body

json
{  
    "key": "your_api_key",  
    "prompt": "ultra realistic close up portrait ((beautiful pale cyberpunk female with heavy black eyeliner))",  
    "negative_prompt": "bad quality",  
    "width": "512",  
    "height": "512",  
    "safety_checker": false,  
    "seed": null,  
    "samples": 1,  
    "base64": false,  
    "webhook": null,  
    "track_id": null
}

Body

application/json

Response

Text-to-image generation response

The response is of type object.