Skip to main content
POST
/
api
/
v1
/
client
/
img2img
cURL
curl --request POST \
  --url https://api.deapi.ai/api/v1/client/img2img \
  --header 'Accept: <accept>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'prompt=A beautiful sunset over mountains' \
  --form model=QwenImageEdit_Plus_NF4 \
  --form steps=20 \
  --form seed=42 \
  --form 'negative_prompt=blur, darkness, noise' \
  --form image='@example-file' \
  --form 'images[]=<string>' \
  --form width=512 \
  --form height=512 \
  --form 'loras={
  "name": "style_lora",
  "weight": 0.75
}' \
  --form guidance=7.5 \
  --form webhook_url=https://your-server.com/webhooks/deapi \
  --form images[].items='@example-file'
{
  "data": {
    "request_id": "c08a339c-73e5-4d67-a4d5-231302fbff9a"
  }
}
Prerequisite: To ensure a successful request, you must first consult the Model Selection endpoint to identify a valid model slug, check specific limits and features, and verify LoRA availability. Please omit the LoRA parameter by default during initial testing.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept
enum<string>
default:application/json
required
Available options:
application/json

Body

multipart/form-data

Image generation parameters. Either "image" or "images[]" must be provided (not both).

prompt
string
required

The main prompt for image generation

Example:

"A beautiful sunset over mountains"

model
string
required

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

Example:

"QwenImageEdit_Plus_NF4"

steps
integer
required

Number of inference steps

Example:

20

seed
integer
required

Random seed for generation

Example:

42

negative_prompt
string | null

Elements to avoid in the generated image

Example:

"blur, darkness, noise"

image
file

Single source image to edit. Required if "images[]" is not provided. Mutually exclusive with "images[]". Supported formats: JPG, JPEG, PNG, GIF, BMP, WebP. Maximum file size: 10 MB.

images[]
file[]

Multiple source images for editing. Maximum count is model-dependent (see model specs max_input_images, defaults to 1). Required if "image" is not provided. Mutually exclusive with "image". Supported formats: JPG, JPEG, PNG, GIF, BMP, WebP. Maximum file size per image: 10 MB.

width
integer | null

Output image width in pixels. Optional - defaults to first input image width if not specified. Subject to model-specific min/max limits.

Example:

512

height
integer | null

Output image height in pixels. Optional - defaults to first input image height if not specified. Subject to model-specific min/max limits.

Example:

512

loras
object[]

Array of LoRA models to apply

guidance
number

Guidance scale for the generation

Example:

7.5

webhook_url
string<uri> | null

Optional HTTPS URL to receive webhook notifications for job status changes (processing, completed, failed). Must be HTTPS. Max 2048 characters. See Webhook Documentation for payload structure and authentication details.

Maximum string length: 2048
Example:

"https://your-server.com/webhooks/deapi"

Response

ID of the inference request.

data
object

Information from success endpoint