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
POST
/v2/txt2img
文本到图像端点,只会返回一个task_id。您应该使用 task_id 调用 /v2/progress API 端点以检索图像生成结果。输出以“image/png”格式提供。指导: https: //novita.ai/get-started/Basic_txt2img.html#_1-txt2img-request-with-normal-parameter。
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v2/txt2img' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
  "extra": {
    "enable_nsfw_detection": false
  },
  "prompt": "nsfw, 1girl, (solo:1.1), small breasts, topless, nipples, thongs, thigh, slicked back short hair, half body in pool, outdoor, pool side, very sexy, wet body, modern villa, southern france, soft light, realistic, intricate details, (light freckles:0.5), lightly tanned, professional photography, depth of field, amazing eyes, (smooth hands:1.1), photoshoot, detailed background, professional model, ultra 4k, photorealist, lace panties",
  "negative_prompt": "(badhandv4:1.2),(worst quality:2),(low quality:2),(normal quality:2),lowres,bad anatomy,bad hands,((monochrome)),((grayscale)) watermark,moles, easynegative ng_deepnegative_v1_75t, (oversized head:2), (big head:2), (deformed face:1.5),( blurry face:2), bad eyes, irregular eyes, asymmetric eyes, ugly, teeth, (navel:0.9), artefact, jpg artefact, blurry face, blurry, blurred, pixelated, bad eyes, crossed eyes, blurry eyes, nipple",
  "sampler_name": "DPM++ 2M Karras",
  "batch_size": 1,
  "n_iter": 1,
  "steps": 25,
  "cfg_scale": 7,
  "seed": -1,
  "height": 512,
  "width": 512,
  "model_name": "anyhentai_20_31826.safetensors",
  "restore_faces": false,
  "restore_faces_model": "",
  "sd_vae": "",
  "clip_skip": 1,
  "enable_hr": false,
  "hr_upscaler": "Latent",
  "hr_scale": 1,
  "hr_resize_x": null,
  "hr_resize_y": null,
  "img_expire_ttl": null,
  "sd_refiner": {
    "checkpoint": "sd_xl_refiner_1.0.safetensors",
    "switch_at": null
  },
  "controlnet_units": [
    {
      "model": "",
      "weight": null,
      "input_image": "",
      "module": "none",
      "control_mode": 0,
      "mask": "",
      "resize_mode": 0,
      "processor_res": null,
      "threshold_a": null,
      "threshold_b": null,
      "guidance_start": null,
      "guidance_end": null,
      "pixel_perfect": false
    }
  ]
}'
响应示例响应示例
{
  "code": 0,
  "msg": "",
  "data": {
    "task_id": "d4cf3973-8414-4a5e-aa6f-ef54caf73662",
    "warn": ""
  }
}

请求参数

Header 参数

Body 参数application/json

示例

返回响应

🟢200成功
application/json
Body

修改于 2024-02-05 08:22:42
上一页
用户信息
下一页
图像到图像
Built with