Image GenerationQwen
Synchronous Editing
Call the Qwen Synchronous Editing API through TokenByte
POST
https://api.tokenbyte.ai/api/v1/image/generation使用 TokenByte 统一图像任务接口调用 Qwen 的Synchronous Editing能力。模型名称请从模型市场复制,不要根据厂商官网名称自行推测。
Header 参数
| 参数 | 必填 | 说明 |
|---|---|---|
Authorization | 是 | Bearer <TOKENBYTE_API_KEY> |
Content-Type | 是 | application/json |
Body 参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | Qwen 模型的完整 ID |
_action | string | 视模型 | 当前模式使用 edit |
prompt | string | 视模式 | 生成或编辑提示词 |
image | string/object/array | 是 | 参考图 URL、Base64 或厂商结构化图片对象 |
size | string | 否 | 输出尺寸或分辨率 |
seed | integer | 否 | 模型支持时控制随机种子 |
模式说明
千问图像模型区分同步、异步以及生成、编辑模式。
仅传入模型明确支持的字段;不支持的参数可能被忽略或返回参数错误。
请求示例
curl https://api.tokenbyte.ai/api/v1/image/generation \
-H "Authorization: Bearer $TOKENBYTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"_action": "edit",
"model": "<model-id>",
"prompt": "描述画面主体、构图、光线和风格",
"image": "https://example.com/reference.png",
"size": "1024x1024"
}'响应
{
"code": 0,
"data": {
"task_id": "image_xxx",
"task_status": "pending",
"urls": []
},
"message": "success",
"request_id": "req_xxx"
}若响应直接包含 urls,可立即读取结果;若返回 task_id,请调用查询图像任务直到进入成功或失败终态。