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
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Header parameters
Acceptstring · enumRequiredDefault:
application/jsonPossible values: Body
promptstringRequiredExample:
The main prompt for image generation
A beautiful sunset over mountainsnegative_promptstring | nullableOptionalExample:
Elements to avoid in the generated image
blur, darkness, noisemodelstringRequiredExample:
The model to use for image generation. Available models can be retrieved via the GET /api/v1/client/models endpoint.
Flux1schnellwidthintegerRequiredExample:
Width of the generated image in pixels
512heightintegerRequiredExample:
Height of the generated image in pixels
512guidancenumberRequiredExample:
Guidance scale for the generation
7.5stepsintegerRequiredExample:
Number of inference steps
20seedintegerRequiredExample:
Random seed for generation
42Responses
200
ID of the inference request.
application/json
401
Unauthorized user.
application/json
404
Unauthorized user.
application/json
post
/api/v1/client/txt2imgPOST /api/v1/client/txt2img HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: application/json
Content-Type: application/json
Content-Length: 218
{
"prompt": "A beautiful sunset over mountains",
"negative_prompt": "blur, darkness, noise",
"model": "Flux1schnell",
"loras": [
{
"name": "style_lora",
"weight": 0.75
}
],
"width": 512,
"height": 512,
"guidance": 7.5,
"steps": 20,
"seed": 42
}{
"data": {
"request_id": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
}
}Last updated