Text-to-Image
Text-to-Image generates images from text prompts. The endpoint returns a ready-to-use image URL and a task ID to track processing status. Ideal for apps needing automated image creation.
post
Endpoint for requesting text2img inference
Authorizations
Header parameters
Acceptstring · enumRequiredPossible values:
Body
promptstringRequiredExample:
The main prompt for image generation
A beautiful sunset over mountains
negative_promptstring | nullableOptionalExample:
Elements to avoid in the generated image
blur, darkness, noise
modelstringRequiredExample:
The model to use for generation
stable-diffusion-v1-5
widthintegerRequiredExample:
Width of the generated image in pixels
512
heightintegerRequiredExample:
Height of the generated image in pixels
512
guidancenumberRequiredExample:
Guidance scale for the generation
7.5
stepsintegerRequiredExample:
Number of inference steps
20
seedintegerRequiredExample:
Random seed for generation
42
Responses
200
ID of the inference request.
application/json
401
Unauthorized user.
application/json
404
Unauthorized user.
application/json
post
POST /api/v1/client/txt2img HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer JWT
Accept: application/json
Content-Type: application/json
Content-Length: 227
{
"prompt": "A beautiful sunset over mountains",
"negative_prompt": "blur, darkness, noise",
"model": "stable-diffusion-v1-5",
"loras": [
{
"name": "style_lora",
"weight": 0.75
}
],
"width": 512,
"height": 512,
"guidance": 7.5,
"steps": 20,
"seed": 42
}
{
"data": {
"request_id": 1
}
}
Last updated