Skip to main content
POST
Generate images from prompts

Body

application/json

Request to generate images from text prompts.

prompt
string | null

Text prompt guiding image generation. Optional for unconditional generation.

negative_prompt
string | null

Textual description of elements to avoid in the generated images.

n
integer
default:1

Number of images to generate.

output_format
enum<string>
default:png

Desired image file format for outputs.

Available options:
png,
jpeg,
webp
response_format
enum<string>
default:url

How generated images are returned: URLs or base64 JSON strings.

Available options:
url,
b64_json
size
default:1024x1024

Desired image size either as preset string or [width, height] pair.

Available options:
256x256,
512x512,
1024x1024,
1792x1024,
1024x1792
num_inference_steps
integer
default:50

Number of denoising / sampling steps used by the diffusion model.

guidance_scale
number
default:7.5

Classifier-free guidance scale; higher values enforce prompt adherence.

seed
integer | null

Optional random seed for reproducibility of generated images.

Response

200 - application/json

List of generated images (URLs or base64 strings)

model
string
created
integer
id
string
data
object[]
size
string
output_format
string