Stable Diffusion
  1. 社区模型 API V4
Stable Diffusion
  • Stable Diffusion API 文档
  • A1111 调度程序
  • Stable Diffusion API
    • 概述
    • 文本到图像
      POST
    • 图像到图像
      POST
    • 修复
      POST
    • 获取排队图像
      POST
    • 系统负载
      POST
  • 训练模型
    • 概述
    • Lora 模型
      POST
    • Dreambooth 模型 (V2)
      POST
    • Dreambooth 模型
      POST
    • 训练状态
      POST
    • 获取模型列表
      POST
    • 删除训练
      POST
    • 取消训练
      POST
    • 裁剪 Base64 图像
      POST
  • 文字转视频
    • 概述
    • 创建视频
      POST
    • 将文本训练为视频
      POST
  • 社区模型 API V4
    • 概述
    • 文本转图像
      POST
    • LoRA
      POST
    • LoRA 多功能设备
      POST
    • 图像到图像
      POST
    • 修复
      POST
    • 获取排队图像接口
      POST
    • 重新加载模型接口
      POST
  • 管理信息系统
    • 概述
    • 裁剪 Base64 图像
    • 删除图像
    • 获取训练过的模型列表
    • 获取公共型号列表
    • 清除用户缓存
    • 购买 Dreambooth 模型
    • 购买订阅计划
    • 取消订阅计划
    • NSFW 图像检查
    • 上传模型
    • 创建房间内部接口
  • 控制网
    • 概述
    • ControlNet 主要终端
    • ControlNet 多功能终端
  • 企业计划
    • 概述
    • 系统详情
    • 重新启动服务器终端
    • 更新服务器
    • 更新 S3 详细信息
    • 清楚缓存
    • 列表调度程序
    • 负载模型
    • 验证模型
    • 获取所有模型
    • 删除模型
    • Controlnet
    • 文字转图像
    • 文字转视频
    • 图像到图像
    • 修复
    • 超分辨率
    • 上传图片
    • 同步模型
    • 负载 Vae
    • NSFW 图像检查
    • 获取排队图像
  • Dreambooth 沙盒
    • 概述
    • 创建 Dreambooth 请求(沙盒)
    • 获取训练状态(沙盒)
  • 图像编辑
    • 概述
    • 外部绘画
    • Blip 扩散
    • 魔术混合接口
    • 图像深度
    • 图像混合器
    • 图像引导编辑
    • 删除背景
    • 超分辨率
    • 混合画布
  • 文本转 3D
    • 概述
    • 文本转 3D
    • 图像转 3D
  • 未经审查的聊天
    POST
  1. 社区模型 API V4

修复

开发环境
https://stablediffusionapi.com/v1
开发环境
https://stablediffusionapi.com/v1
POST
https://stablediffusionapi.com/api/v4/dreambooth/inpaint
Dreambooth Inpainting API 用于根据特定要求、基于经过训练的模型或公共模型来更改(修复)图像的某些部分。将适当的请求参数传递到端点。
该端点根据图像和掩码生成并返回图像,掩码与请求中的 URL 以及模型的 ID 一起传递。
您还可以通过传递提示和否定提示来添加对所需结果的描述。
POST向https://stablediffusionapi.com/api/v4/dreambooth/inpaint 接口发出请求,并将所需参数作为请求正文传递。
该接口还支持调度程序。使用请求正文中的“scheduler”参数来设置要从以下列表中使用的特定调度程序:
DDPMScheduler
DDIMScheduler
PNDMScheduler
LMSDiscreteScheduler
EulerDiscreteScheduler
EulerAncestralDiscreteScheduler
DPMSolverMultistepScheduler
HeunDiscreteScheduler
KDPM2DiscreteScheduler
DPMSolverSinglestepScheduler
KDPM2AncestralDiscreteScheduler
UniPCMultistepScheduler
DDIMInverseScheduler
DEISMultistepScheduler
IPNDMScheduler
KarrasVeScheduler
ScoreSdeVeScheduler
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://stablediffusionapi.com/api/v4/dreambooth/inpaint' \
--header 'Content-Type: application/json' \
--data-raw '{
  "key": "",
  "model_id": "your_model_id",
  "prompt": "a cat sitting on a bench",
  "negative_prompt": null,
  "init_image": "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png",
  "mask_image": "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png",
  "width": "512",
  "height": "512",
  "samples": "1",
  "steps": "30",
  "safety_checker": "no",
  "enhance_prompt": "yes",
  "guidance_scale": 7.5,
  "strength": 0.7,
  "scheduler": "UniPCMultistepScheduler",
  "lora_model": null,
  "tomesd": "yes",
  "use_karras_sigmas": "yes",
  "vae": null,
  "lora_strength": null,
  "embeddings_model": null,
  "seed": null,
  "webhook": null,
  "track_id": null
}'
响应示例响应示例
{
  "status": "success",
  "generationTime": 20.970642805099487,
  "id": 13446970,
  "output": [
    "https://pub-8b49af329fae499aa563997f5d4068a4.r2.dev/generations/dc639bd6-d605-42c7-950e-48c531124d0d-0.png"
  ],
  "meta": {
    "prompt": " a cat sitting on a bench DSLR photography, sharp focus, Unreal Engine 5, Octane Render, Redshift, ((cinematic lighting)), f/1.4, ISO 200, 1/160s, 8K, RAW, unedited, symmetrical balance, in-frame",
    "model_id": "midjourney-v4-painta",
    "scheduler": "PNDMScheduler",
    "safetychecker": "no",
    "negative_prompt": " ((out of frame)), ((extra fingers)), mutated hands, ((poorly drawn hands)), ((poorly drawn face)), (((mutation))), (((deformed))), (((tiling))), ((naked)), ((tile)), ((fleshpile)), ((ugly)), (((abstract))), blurry, ((bad anatomy)), ((bad proportions)), ((extra limbs)), cloned face, glitchy, ((extra breasts)), ((double torso)), ((extra arms)), ((extra hands)), ((mangled fingers)), ((missing breasts)), (missing lips), ((ugly face)), ((fat)), ((extra legs))",
    "W": 512,
    "H": 512,
    "guidance_scale": 7.5,
    "init_image": "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png",
    "mask_image": "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png",
    "multi_lingual": "no",
    "steps": 50,
    "n_samples": 1,
    "full_url": "no",
    "upscale": "no",
    "seed": 1343687916,
    "outdir": "out",
    "file_prefix": "dc639bd6-d605-42c7-950e-48c531124d0d"
  }
}

请求参数

Body 参数application/json

示例

返回响应

🟢200成功
application/json
Body

修改于 2023-10-31 03:52:48
上一页
图像到图像
下一页
获取排队图像接口
Built with