Novita.ai
  1. 案例 API
Novita.ai
  • Novita.ai
  • 账户接口
    • 配置s3配置
      POST
    • 查询s3配置
      GET
    • 删除 s3 配置
      DELETE
    • 用户信息
      GET
  • 基本 API
    • 文字转图像
      POST
    • 图像到图像
      POST
    • 进步
      GET
    • 广告商
      POST
  • 基础 API V3
    • 使用 lcm 将文本转为图像
    • 使用 lcm 进行图像到图像
    • 获取异步任务结果
    • 文字转图像
    • 图像到图像
  • 模型 API
    • 同步 civitai 模型
    • 查询 civitai 模型
    • 查询模型
  • 案例 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
POST
/v3/outpainting
扩展图像的边界或为图像的边缘提供额外的变化。您可以在这里获取指导:https://novita.ai/get-started/UseCase_ImageEnhancement.html#_4-outpainting。
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v3/outpainting' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "image_file": "{{base64 encoded images}}",
  "prompt": "analog film photo, photo of a beautiful woman, (wearing a colorful bikini:1.1), short blonde hair, flashing, female model, fashion show, catwalk, small breasts, sunny beach , RAW Photograph, dslr, soft lighting, high quality, film grain, Fujifilm XT3 detailed skin with visible pores, insane details, masterpiece, 8k, 35mm photograph, dslr, kodachrome, faded film, desaturated, 35mm photo, grainy, vintage, Kodachrome, Lomography, stained, highly detailed, found footage",
  "negative_prompt": "",
  "width": 768,
  "height": 1024,
  "center_x": 0,
  "center_y": 0,
  "extra": {
    "response_image_type": "png",
    "enterprise_plan": {
      "enabled": false
    }
  }
}'
响应示例响应示例
200 - 成功示例
{
  "image_file": "{{base64 of returned image_file}}",
  "image_type": "png"
}

请求参数

Header 参数
Authorization
string 
必需
Content-Type
string 
必需
Body 参数application/json
image_file
string 
必需
原图base64,最大分辨率1024*1024,最大文件大小30Mb。
prompt
string 
必需
肯定提示词,用“,”分隔。
negative_prompt
string 
可选
否定提示词,用“,”分隔
width
integer 
必需
外画图像的宽度(px),需要大于原图的宽度,允许的值范围为:256 ~ 1024(px)。
height
integer 
必需
外画图像的高度(px),需要大于原图的高度,允许的值范围是:256 ~ 1024 (px)。
center_x
integer 
必需
原始图像中心与扩展图像中心在 X 轴方向上的偏移量 (px)。默认值为 0。允许的值范围为 -width/2 ~ width/2。
center_y
integer 
必需
原始图像中心与扩展图像中心之间在 Y 轴方向上的偏移量 (px)。默认值为 0。允许的值范围为 -height/2 ~ height/2。
extra
object 
必需
response_image_type
string 
返回图像的格式。
可选
enterprise_plan
object 
可选
示例

返回响应

🟢200成功
application/json
Body
image_file
string 
必需
image_type
string 
必需
🟠400请求有误
上一页
清除
下一页
删除背景
Built with