Skip to content

Qwen image edit

Image edit shares the same model family as text-to-image, but uses the edit route. Supports JSON multimodal requests and file upload.

http
POST /v1/images/edits

Available models

Headers

NameTypeRequiredDescription
stringYesRequest authentication. Use a Bearer Token, for example:
stringNoRequest content type. For JSON bodies set ; for the client sets it automatically (e.g. curl with )—do not set it manually

Request body

NameTypeRequiredDescription
stringYesMust be or
objectNoNative multimodal input with (one message only; fixed to ; has 1–3 items and one )
objectNoQwen image generation parameters ( in native , , , , ). When provided explicitly, the adapter uses them directly
stringNoEdit instruction for the multipart format
file | stringNoReference image file for the multipart format; can be repeated for multiple files
integerNoMultipart output count. Treated as when omitted or
booleanNoMultipart watermark switch

input.messages.content item

NameTypeRequiredDescription
stringNoText content: the edit instruction
stringNoReference image URL (HTTP/HTTPS) or a Data URL with MIME prefix. Formats: JPG, JPEG, PNG, BMP, TIFF, WEBP, GIF. Official recommendation: width/height between 384–2048 px; each file ≤ 10 MB

parameters

NameTypeRequiredDescription
stringNoOutput size in native format (e.g. )
integerNoNumber of output images; upstream currently allows 1–6. Treated as when omitted or
booleanNoWhether to add a watermark
booleanNoWhether to enable prompt expansion
integerNoRandom seed

Multipart file upload

Multipart requests submit these fields with : , , one or more , , .

Repeat the field for multiple files:

bash
--form 'image=@/absolute/path/reference-1.png' \
--form 'image=@/absolute/path/reference-2.png'

Request example

bash
curl --request POST https://octopusx.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "qwen-image-3.0-pro",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          { "image": "https://example.com/reference.png" },
          { "text": "Keep the person's facial features and change the clothing to an urban professional style" }
        ]
      }
    ]
  },
  "parameters": {
    "prompt_extend": true,
    "size": "1080*1080",
    "n": 1,
    "watermark": false
  }
}'
bash
curl --request POST https://octopusx.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --form 'model=qwen-image-3.0-pro' \
  --form 'prompt=Keep facial features and change the clothing to an urban professional style' \
  --form 'image=@/absolute/path/reference.png' \
  --form 'n=1' \
  --form 'watermark=false'
json
{
  "model": "qwen-image-3.0-pro",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          { "image": "https://example.com/person.png" },
          { "image": "https://example.com/style.png" },
          { "text": "Keep the person from the first image and apply the painting style from the second" }
        ]
      }
    ]
  },
  "parameters": {
    "size": "1024*1536",
    "n": 1
  }
}
json
{
  "image": "data:image/png;base64,iVBORw0KGgoAAA..."
}

Response example

json
{
  "created": 1788188983,
  "data": [
    {
      "url": "https://example.com/generated.png"
    }
  ],
  "metadata": {
    "output": {
      "choices": [
        {
          "finish_reason": "stop",
          "message": {
            "role": "assistant",
            "content": [
              {
                "type": "image",
                "image": "https://example.com/generated.png"
              }
            ]
          }
        }
      ]
    },
    "request_id": "example-request-id",
    "usage": {
      "input_image_count": 1,
      "input_image_type": "qima_input_1k",
      "output_image_count": 1,
      "output_image_type": "qima_output_1k",
      "output_width": 1080,
      "output_height": 1080
    }
  }
}

Response fields

Image-to-image / edit shares the same response structure as text-to-image. For field definitions of created, data (including url, revised_prompt), metadata (including output, request_id, usage), and the error object error (message, type, param, code), plus error-code meanings and troubleshooting, see Qwen image generation · Response fields.

The only difference from text-to-image: reflects the number of reference images actually sent for this request (always for text-to-image).

Notes

WARNING

The multipart path does not build full Qwen image parameters. To control , , or , use a JSON multimodal request.