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
promptstringRequired

The main prompt for image generation

Example: A beautiful sunset over mountains
negative_promptstring | nullableOptional

Elements to avoid in the generated image

Example: blur, darkness, noise
modelstringRequired

The model to use for generation

Example: stable-diffusion-v1-5
widthintegerRequired

Width of the generated image in pixels

Example: 512
heightintegerRequired

Height of the generated image in pixels

Example: 512
guidancenumberRequired

Guidance scale for the generation

Example: 7.5
stepsintegerRequired

Number of inference steps

Example: 20
seedintegerRequired

Random seed for generation

Example: 42
Responses
200

ID of the inference request.

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