Novita.ai
  1. 基础 API V3
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 V3

使用 lcm 将文本转为图像

开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/v3/lcm-txt2img
通过潜在一致性模型,图像生成速度提高 10 倍,通过几步推理即可合成高分辨率图像。您可以在此处获取指导:https://novita.ai/get-started/Basic_txt2img.html#_6-txt2img-request-with-lcm。
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v3/lcm-txt2img' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "prompt": "A dog",
  "height": 1024,
  "width": 1024,
  "image_num": 1,
  "steps": 8,
  "guidance_scale": 8
}'
响应示例响应示例
[
  [
    {
      "image_file": "",
      "image_type": ""
    }
  ],
  500,
  "INTERNAL",
  "failed to exec task, err: failed to lcm-txt2img: failed to request API: invalid api status code: 500, body: {\"code\":2,\"message\":\"NoneType: None\\n\"}",
  {
    "task_id": "4788a484-9a17-4a6f-8441-743c9b6763b2"
  }
]

请求参数

Header 参数
Authorization
string 
必需
Content-Type
string 
必需
示例值:
application/json
Body 参数application/json
prompt
string 
必需
涂鸦的正面提示词,用“,”分隔。范围:[1, 1024]
height
integer 
必需
图像的高度。范围:[128, 1024]
width
integer 
必需
图像的宽度。范围:[128, 1024]
image_num
integer 
必需
图像编号。范围:[1, 16]
steps
integer 
必需
图像创建过程的迭代。范围:[1, 8]
guidance_scale
integer 
必需
此设置表示模型将听取您的提示的程度。范围:[2.0,14.0]
示例

返回响应

🟢200成功
application/json
Body
array [oneOf] 
可选
array[string]
可选
object 
可选
image_file
string 
可选
image_type
string 
可选
integer 
可选
string 
可选
object 
可选
task_id
string 
可选
上一页
广告商
下一页
使用 lcm 进行图像到图像
Built with