Choose a model for the work you need to doMe
Official APIBeijingVersion 1
Edit a source image with text instructions. Use masks and compositing when the product must be preserved precisely.
Image editing
API BASE URL
https://${WORKSPACE_ID}.cn-beijing.maas.aliyuncs.com/api/v1Actual API model ID
qwen-image-edit-maxRequest method / path
POST /services/aigc/multimodal-generation/generationAuthentication
Authorization: Bearer $API_KEYEdit request parameters
Edit JSON within the verified parameter ranges. Copy and export stop if types, required fields, or enum values are invalid.
# 先在当前终端设置环境变量:API_KEY, WORKSPACE_ID, IMAGE_URL
# 下面只创建请求文件,不执行文本中的任何命令。
cat > request.json <<'MODEL_ATLAS_REQUEST'
{
"input": {
"messages": [
{
"role": "user",
"content": [
{
"image": "${IMAGE_URL}"
},
{
"text": "将背景改为明亮的咖啡馆,尽量保持主体不变。"
}
]
}
]
},
"model": "qwen-image-edit-max"
}
MODEL_ATLAS_REQUEST
# 替换 request.json 内的用户占位符后再运行请求。
curl --fail-with-body --request POST "https://${WORKSPACE_ID}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${API_KEY}" \
--data-binary @request.json
