Novita.ai
  1. 基本 API
Novita.ai
  • Novita.ai
  • 账户接口
    • 配置s3配置
      POST
    • 查询s3配置
      GET
    • 删除 s3 配置
      DELETE
    • 用户信息
      GET
  • 基本 API
    • 文字转图像
      POST
    • 图像到图像
      POST
    • 进步
      GET
    • 广告商
      POST
  • 基础 API V3
    • 使用 lcm 将文本转为图像
      POST
    • 使用 lcm 进行图像到图像
      POST
    • 获取异步任务结果
      GET
    • 文字转图像
      POST
    • 图像到图像
      POST
  • 模型 API
    • 同步 civitai 模型
      POST
    • 查询 civitai 模型
      GET
    • 查询模型
      GET
  • 案例 API
    • Upscale
      POST
    • 清除
      POST
    • 外画
      POST
    • 删除背景
      POST
    • 删除文字
      POST
    • 重新想象
      POST
    • 涂鸦
      POST
    • 混合姿势
      POST
    • 替换背景
      POST
    • 替换天空
      POST
    • 恢复面容
      POST
    • 创建图块
      POST
    • 去除水印
      POST
    • 合并面
      POST
    • 替换对象
      POST
    • 图片提示
      POST
    • 制作照片
      POST
    • 要遮罩的图像
      POST
  • 培训 API
    • 获取图片网址
    • 接受学科培训
    • 创建学科培训
    • 创建风格训练
    • 接受风格培训
    • 列出训练任务
  • 视频 API
    • 图像转视频 API
    • 图像到视频运动 API
    • 文本转视频 API
  1. 基本 API

进步

开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
GET
/v2/progress
该接口提供图像生成结果的查询,可以是正在进行中、失败或成功。如果成功,它将返回生成图像的 s3 URL。
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'http://dev-cn.your-api-server.com/v2/progress?task_id=' \
--header 'Authorization;'
响应示例响应示例
{
  "code": 0,
  "msg": "",
  "data": {
    "status": 2,
    "progress": 1,
    "eta_relative": 0,
    "imgs": [
      "https://stars-test.s3.amazonaws.com/free/859d452b-f682-45fc-b0e7-5bd7b61a107d-0.png",
      "https://stars-test.s3.amazonaws.com/free/859d452b-f682-45fc-b0e7-5bd7b61a107d-1.png",
      "https://stars-test.s3.amazonaws.com/free/859d452b-f682-45fc-b0e7-5bd7b61a107d-2.png",
      "https://stars-test.s3.amazonaws.com/free/859d452b-f682-45fc-b0e7-5bd7b61a107d-3.png"
    ],
    "failed_reason": "",
    "current_images": [
      ""
    ],
    "submit_time": "2024-01-24 15:08:17",
    "execution_time": "2024-01-24 15:08:17",
    "txt2img_time": "2024-01-24 15:08:22",
    "finish_time": "2024-01-24 15:08:22",
    "info": "",
    "enable_nsfw_detection": true,
    "nsfw_detection_result": [
      {
        "valid": true,
        "confidence": 57.62467
      },
      {
        "valid": true,
        "confidence": 3.908125
      },
      {
        "valid": true,
        "confidence": 99.84468
      },
      {
        "valid": true,
        "confidence": 2.440833
      }
    ],
    "debug_info": {
      "submit_time_ms": 1706080097101,
      "execution_time_ms": 1706080097369,
      "txt2img_time_ms": 1706080102333,
      "finish_time_ms": 1706080102479
    }
  }
}

请求参数

Query 参数
task_id
string 
任务ID
必需
Header 参数
Authorization
string 
必需

返回响应

🟢200成功
application/json
Body
code
integer 
必需
CodeNormal=0 CodeInternalError=-1 CodeInvalidJSON=1 CodeModelNotExist=2 CodeTaskIdNotExist=3 CodeInvalidAuth=4 CodeHostUnavailable=5 CodeParamRangeOutOfLimit=6 CodeCostBalanceFailure=7 CodeSamplerNotExist=8 CodeTimeout=9 CodeNotSupport=10
msg
string 
必需
data
object 
必需
status
integer 
可选
生成状态: - 0 = 正在初始化 - 1 = 正在进行 - 2 = 成功 - 3 = 失败 - 4 = 超时。
progress
integer 
可选
生成图像的进度,取值范围为[0, 1]。
eta_relative
integer 
可选
估计剩余时间(以秒为单位)。
imgs
array[string]
可选
生成图像的S3地址。
failed_reason
string 
可选
如果 status = 3 或 4,则返回失败原因。
current_images
array[string]
可选
与稳定扩散类似,也会返回图像生成过程中的预览图像。为了方便开发者,目前预览图是按照batch_size来划分的。
submit_time
string 
任务提交时间。
可选
execution_time
string 
开始任务执行时间。
可选
txt2img_time
string 
可选
由稳定扩散时间生成的图像。
finish_time
string 
可选
图片上传至存储时间。
info
string 
可选
Stable Diffusion 的 info 信息以 JSON 字符串形式返回。
enable_nsfw_detection
boolean 
必需
是否启用 nsfw 检测。
nsfw_detection_result
array [object {2}] 
可选
debug_info
object 
可选
修改于 2024-02-05 08:22:46
上一页
图像到图像
下一页
广告商
Built with