Skip to main content

Bailian Qwen-Image series

Edit or generate from a reference (depth, edges, etc.) plus a prompt using Qwen-Image-Edit on Bailian.

Basics

  • Endpoint: POST /v1/images/edits
  • Auth: Bearer Token (Authorization: Bearer sk-xxxxxx)
  • Content-Type: application/json

Request body

FieldTypeRequiredDescription
modelstringYese.g. qwen-image-edit-plus.
inputobjectYesInput wrapper.
└─ messagesarrayYesMessage list.
└─ └─ rolestringYesUsually user.
└─ └─ contentarrayYesMix of image (reference URL) and text (edit instruction).
parametersobjectNoControls.
└─ nintegerNoNumber of outputs.
└─ negative_promptstringNoNegative prompt.
└─ prompt_extendbooleanNoAuto expand prompt (default true).
└─ watermarkbooleanNoWatermark on/off.
└─ sizestringNoOutput size.

Response

200 OK
FieldTypeDescription
createdintegerUnix timestamp.
dataarrayResults.
└─ urlstringEdited image URL.
└─ b64_jsonstringBase64 data.
└─ revised_promptstringFinal prompt after optimization.

Request example

{
  "model": "qwen-image-edit-plus",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "image": "https://example.com/reference_depth_map.webp"
          },
          {
            "text": "Generate an image consistent with the depth map: a rusty red bicycle on a muddy path, dense old-growth forest in the background"
          }
        ]
      }
    ]
  },
  "parameters": {
    "n": 1,
    "prompt_extend": true,
    "watermark": false
  }
}

Tips

  1. Reference mode: Unlike OpenAI alpha-mask editing, Qwen edit is often used for structure control—depth maps, line art, etc.—then generate to match the text.
  2. Multimodal input: content should include both an image object and a text object so the model has visual and textual guidance.