Skip to content

Qwen / Wan ​

Image API for generating images from text descriptions or reference images. Models are distinguished via the model parameter. content arrays support text and image for text-to-image and image-to-image.

Image Generation ​

http
POST /v1/images/generations
bash
curl --location --request POST 'https://neolink.com/api/v1/images/generations' \
--header 'Authorization: Bearer <API Key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "<Model ID>",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp"
},
{
"text": "In the lower right corner of the picture, beside the stone path and near the base of the tree trunk, write a seven-character quatrain in light gray ink handwritten style..."
}
]
}
]
},
"parameters": {
"n": 1,
"watermark": false,
"size": "2048*2048"
}
}'
python
import requests
url = "https://neolink.com/api/v1/images/generations"

headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <API Key>",
}

payload = {
"model": "<Model ID>",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260310/jiydyi/image+%2818%29-2026-03-10-16-39-59.webp"
},
{
"text": "In the lower right corner of the picture..."
}
]
}
]
},
"parameters": {
"n": 1,
"watermark": false,
"size": "2048*2048"
}
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
result = response.json()
print(result)

Note: Qwen and Wan models share the same /v1/images/generations endpoint, distinguished by the model parameter. The content array can include both text (text prompt) and image (reference image URL) types, enabling text-to-image and image-to-image generation.