Skip to content

绘图任务

← API 参考 · English

用户级 draw Key(见 API Key 与鉴权)创建与查询文生图任务。任务异步执行:先拿到任务 uuid,再轮询详情直到完成。

创建绘图任务

http
POST /ext/v1/draw/generation
参数类型必填说明
promptstring提示词
negativePromptstring负向提示词
sizestring图片尺寸(取决于模型,如 1024x1024
qualitystring图片质量(支持的模型适用)
numberint生成张数,≥ 1,默认 1
modelstring图片模型名
seedint随机种子

响应:

json
{ "uuid": "<任务uuid>" }

查询绘图任务

http
GET /ext/v1/draw/{uuid}

只能查询属于 Key 属主的任务,否则返回 A_DRAW_NOT_FOUND

响应字段(DrawDto)

字段说明
uuid任务 ID
prompt提示词
aiModelName / aiModelPlatform所用模型与平台
interactingMethod生成方式
isPublic是否公开
starCount / isStar点赞数与当前用户是否点赞
processStatus处理状态(据此判断是否完成)
processStatusRemark状态说明(失败原因等)
imageUuids / imageUrls生成图片的 ID 与访问地址
duration耗时
dynamicParams模型动态参数
originalImageUuid/UrlmaskImageUuid/Url原图 / 引导图(背景生成等场景)
userUuid / userName / createTime归属与时间

示例

bash
# 创建任务
curl -X POST "http://<host>:9999/ext/v1/draw/generation" \
  -H "Authorization: <draw用户级Key>" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "一只在月光下的白色猫头鹰,水墨风", "number": 2}'

# 轮询详情,processStatus 完成后从 imageUrls 取图
curl "http://<host>:9999/ext/v1/draw/<任务uuid>" \
  -H "Authorization: <draw用户级Key>"

上一篇:知识库问答 | 下一篇:MCP 服务