查询任务结果
GET
/engine/status/{uid}接口能力
查询任务的生成结果。通常在提交生成任务后,轮询请求此接口,直到获取到任务完成结果。
积分扣除规则
调用此接口不消耗积分
请求参数
Path 参数
uid
string
必需
Header 参数
Content-Type
string
必需
示例值:
application/json
Authorization
string
必需
此值可以在 开放平台(https://open.creator.nolibox.com) - 应用列表 - 操作中的"TOKEN"中获取。计算方式:"Basic " + Base64.encode(App Key:App Secret)
示例值:
Basic xxxxxxxxxx
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
status
enum<string>
状态描述
枚举值:
pendingworkingfinishedexceptionnot_found
示例值:
pending
pending
integer <uint32>
排队顺位
开始处理后,此值为 0
示例值:
2
data
object
必需
uid
string
生成接口返回的 uid
cdn
string
图片地址
safe 是 false时,此值为空字符串
img_urls
string
图片地址列表
当一次生成多张图片时,此字段返回全部图片地址。
safe
boolean
图片是否通过了敏感检测
通过为 true
,未通过 false
,当图片未通过敏感检测时,cdn
和 img_urls
为空。
reason
string
没有通过敏感检测的原因
目前常见的为 Politics,Porn 和 Terrorism
create_time
number
任务创建的时间戳(秒为单位)
示例值:
1671985822.9016767
start_time
number
任务开始执行时的时间戳(秒为单位)
示例值:
1668445136.2136354
end_time
number
任务执行完毕时的时间戳(秒为单位)
示例值:
1668445136.2136354
duration
number
任务总生成时长(秒为单位)
示例值:
11.266921043395996
示例
生成成功示例
{
"status": "finished",
"pending": 0,
"data": {
"cdn": "https://ailab-huawei-cdn.nolibox.com/aigc-wms2/images/0d1cf56abf4943718fc21dbab443ab65.png",
"cos": "https://ailab-1d01.obs.cn-north-4.myhuaweicloud.com/aigc-wms2/images/0d1cf56abf4943718fc21dbab443ab65.png",
"safe": true,
"reason": "",
"create_time": 1671985822.9016767,
"start_time": 1671985822.9120295,
"end_time": 1671985833.2287154,
"duration": 10.327038764953613,
"elapsed_times": {
"pending": 0.010352849960327148,
"run_algorithm": 9.226219177246094,
"algorithm_latencies": {
"download": 0.0897681713104248,
"get_model": 0.000029802322387695312,
"inference": 9.134761810302734,
"cleanup": 0.0000095367431640625,
"__total__": 9.224569320678711
},
"upload": 0.04525947570800781,
"audit": 1.0451953411102295,
"redis": 0.0010335445404052734,
"callback": 0.13400006294250488
},
"request": {
"task": "img2img.sd",
"model": {
"callback_url": "https://www.nolibox.com/creator_articles/debug/callback",
"use_circular": false,
"seed": -1,
"variation_seed": 0,
"variation_strength": 0,
"variations": [],
"num_steps": 20,
"guidance_scale": 7.5,
"negative_prompt": "",
"is_anime": false,
"version": "v1.5",
"sampler": "k_euler",
"clip_skip": -1,
"custom_embeddings": {},
"max_wh": 1024,
"url": "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgss0.baidu.com%2F-fo3dSag_xI4khGko9WTAnF6hhy%2Fzhidao%2Fpic%2Fitem%2Fa08b87d6277f9e2f3169c9b31f30e924b899f329.jpg&refer=http%3A%2F%2Fgss0.baidu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1674394536&t=eb088712ad5b9cb875417c0be11bc85f",
"text": "running dog",
"fidelity": 0.2,
"keep_alpha": true
}
}
}
}
最后修改时间: 2 年前