Skip to main content
POST
Generate image from text prompt (Real-Time)
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

Body

json

Body

application/json
key
string
required

Your API Key used for request authorization.

prompt
string
required

Text prompt with description of the things you want in the image to be generated.

negative_prompt
string

Items you don't want in the image.

width
integer
default:512

Width of the generated image in pixels. Max: 1024.

Required range: x <= 1024
height
integer
default:512

Height of the generated image in pixels. Max: 1024.

Required range: x <= 1024
samples
integer
default:1

Number of images to be returned in response. Maximum value is 4.

Required range: x <= 4
safety_checker
boolean
default:false

A checker for NSFW images. If such an image is detected, it will be replaced by a blank image.

seed
integer | null

Seed is used to reproduce results; the same seed will give you the same image in return. Pass 'null' for a random number.

instant_response
boolean
default:false

Queue response instantly before processing finishes instead of waiting a minimum amount of time.

base64
boolean
default:false

Get response as base64 string.

webhook
string<uri>

URL to get a POST API call once the image generation is complete.

track_id
string

This ID is returned in the response to the webhook API call and is used to identify the webhook request.

Response

Text-to-image generation response

status
enum<string>

Status of the image generation.

Available options:
success
generationTime
number

Time taken to generate the image in seconds.

id
integer

Unique identifier for the image generation request.

output
string<uri>[]

Array of generated image URLs.

Array of proxy image URLs.

meta
object

Metadata about the image generation including all parameters used.

nsfw_content_detected
boolean

Indicates if NSFW content was detected in the generated image.