Image-to-Image

Image-to-Image transforms an existing image based on a new text prompt or style input. The endpoint returns a ready-to-use modified image URL and a task ID to track processing status.

post

Endpoint for requesting ima2img inference

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Header parameters
Acceptstring · enumRequiredDefault: application/jsonPossible 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
imagestring · binaryRequired

Source image to edit. Supported formats: JPG, JPEG, PNG, GIF, BMP, WebP. Maximum file size: 10 MB.

modelstringRequired

The model to use for image editing. Available models can be retrieved via the GET /api/v1/client/models endpoint.

Example: stable-diffusion-v1-5
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
/api/v1/client/img2img
POST /api/v1/client/img2img HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: application/json
Content-Type: multipart/form-data
Content-Length: 219

{
  "prompt": "A beautiful sunset over mountains",
  "negative_prompt": "blur, darkness, noise",
  "image": "binary",
  "model": "stable-diffusion-v1-5",
  "loras": [
    {
      "name": "style_lora",
      "weight": 0.75
    }
  ],
  "guidance": 7.5,
  "steps": 20,
  "seed": 42
}
{
  "data": {
    "request_id": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
  }
}
post

Endpoint for calculating price for img2img inference

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Header parameters
Acceptstring · enumRequiredDefault: application/jsonPossible 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
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

Calculated price for text2img inference.

application/json
post
/api/v1/client/img2img/price-calculation
POST /api/v1/client/img2img/price-calculation HTTP/1.1
Host: api.deapi.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: application/json
Content-Type: application/json
Content-Length: 202

{
  "prompt": "A beautiful sunset over mountains",
  "negative_prompt": "blur, darkness, noise",
  "model": "stable-diffusion-v1-5",
  "loras": [
    {
      "name": "style_lora",
      "weight": 0.75
    }
  ],
  "guidance": 7.5,
  "steps": 20,
  "seed": 42
}
{
  "data": {
    "price": 0.25
  }
}

Last updated