Stable Diffusion
  1. 控制网
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 主要终端
      POST
    • ControlNet 多功能终端
      POST
  • 企业计划
    • 概述
    • 系统详情
    • 重新启动服务器终端
    • 更新服务器
    • 更新 S3 详细信息
    • 清楚缓存
    • 列表调度程序
    • 负载模型
    • 验证模型
    • 获取所有模型
    • 删除模型
    • Controlnet
    • 文字转图像
    • 文字转视频
    • 图像到图像
    • 修复
    • 超分辨率
    • 上传图片
    • 同步模型
    • 负载 Vae
    • NSFW 图像检查
    • 获取排队图像
  • Dreambooth 沙盒
    • 概述
    • 创建 Dreambooth 请求(沙盒)
    • 获取训练状态(沙盒)
  • 图像编辑
    • 概述
    • 外部绘画
    • Blip 扩散
    • 魔术混合接口
    • 图像深度
    • 图像混合器
    • 图像引导编辑
    • 删除背景
    • 超分辨率
    • 混合画布
  • 文本转 3D
    • 概述
    • 文本转 3D
    • 图像转 3D
  • 未经审查的聊天
    POST
  1. 控制网

ControlNet 主要终端

开发环境
https://stablediffusionapi.com/v1
开发环境
https://stablediffusionapi.com/v1
POST
https://stablediffusionapi.com/api/v5/controlnet
您现在可以使用 ControlNet 控制稳定扩散。ControlNet 模型在此 API 中可用。
您现在可以使用 ControlNet 控制稳定扩散。ControlNet 模型在此 API 中可用。
提示
您还可以使用此端点通过 ControlNet 修复图像。只需确保将链接传递到mask_image请求正文中,并使用controlnet_model带有“inpaint”值的参数即可。
信息
在深入了解之前,请阅读我们有关 ControlNet 优势的详细**博客文章。**
POST向 https://stablediffusionapi.com/api/v5/controlnet 接口发送请求。
提示
您也可以使用多个 ControlNet 模型。只需在请求体中,将逗号分隔的控制网模型作为"canny,depth" 传递给 controlnet_model,并将 init_image 传入即可。

模型#

默认使用 Controlnet 1.1 的 ControlNet API: 支持的 controlnet_model:
canny - Canny边缘检测
depth - 深度估计
hed - 图像边缘检测
mlsd - 多尺度线段检测
normal - 法线估计
openpose - 开源人体姿态估计
scribble - 图像涂鸦
segmentation - 图像分割
aesthetic-controlnet - 美学评价
inpaint - 图像修复
softedge - 图片边缘平滑
lineart - 线条绘制
shuffle - 风格迁移
tile - 平铺纹理合成
face_detector - 人脸检测
qrcode - QR码检测

调度程序#

该端点还支持调度程序。使用请求正文中的“scheduler”参数传递以下列表中的特定调度程序:
该接口还支持调度程序。使用请求正文中的“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/v5/controlnet' \
--header 'Content-Type: application/json' \
--data-raw '{
  "key": "",
  "controlnet_model": "canny",
  "controlnet_type" :"canny",
  "model_id": "midjourney",
  "auto_hint": "yes",
  "guess_mode" : "no",
  "prompt": "a model doing photoshoot, ultra high resolution, 4K image",
  "negative_prompt": null,
  "init_image": "https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_openpose.png",
  "mask_image": null,
  "width": "512",
  "height": "512",
  "samples": "1",
  "scheduler": "UniPCMultistepScheduler",
  "num_inference_steps": "30",
  "safety_checker": "no",
  "enhance_prompt": "yes",
  "guidance_scale": 7.5,
  "controlnet_conditioning_scale": 0.5,
  "strength": 0.55,
  "lora_model": "more_details",
  "clip_skip": "2",
  "tomesd": "yes",
  "use_karras_sigmas": "yes",
  "vae": null,
  "lora_strength": null,
  "embeddings_model": null,
  "seed": null,
  "webhook": null,
  "track_id": null
}'
响应示例响应示例
{
  "status": "string",
  "tip": "string",
  "eta": 0,
  "messege": "string",
  "fetch_result": "string",
  "id": 0,
  "output": "string",
  "meta": {
    "prompt": "string",
    "model_id": "string",
    "controlnet_model": "string",
    "controlnet_type": "string",
    "negative_prompt": "string",
    "scheduler": "string",
    "safetychecker": "string",
    "auto_hint": "string",
    "guess_mode": "string",
    "strength": 0,
    "W": 0,
    "H": 0,
    "guidance_scale": 0,
    "seed": 0,
    "multi_lingual": "string",
    "init_image": "string",
    "mask_image": null,
    "steps": 0,
    "full_url": "string",
    "upscale": "string",
    "n_samples": 0,
    "embeddings": null,
    "lora": null,
    "outdir": "string",
    "file_prefix": "string"
  }
}

请求参数

Body 参数application/json
key
string 
必需
您用于请求授权的 API Key
model_id
string 
必需
要使用的模型的 ID。它可以是公共的,也可以是您训练有素的模型。
controlnet_model
string 
必需
ControlNet 型号 ID。它可以来自模型列表或用户训练的。
controlnet_type
string 
必需
ControlNet 模型类型。它可以来自型号列表。
auto_hint
string 
必需
自动提示图像;选项:是/否
guess_mode
string 
必需
如果您没有通过任何提示,请将其设置为yes 。该模型将尝试猜测init_image中的内容并自行创建最佳变体。选项:是/否
prompt
string 
必需
文本提示,包含所需图像修改的描述。尽可能详细以获得最佳结果。
negative_prompt
null 
必需
图像中您不想要的项目
init_image
string 
链接到初始图像
必需
mask_image
null 
必需
链接到用于修复的蒙版图像
width
string 
必需
最大高度: 宽度: 1024x1024
height
string 
必需
最大高度: 宽度: 1024x1024
samples
string 
必需
作为响应返回的图像数量。最大值为 4。
scheduler
string 
必需
用它来设置调度程序。
tomesd
string 
必需
启用 tomesd 生成图像:给出非常快的结果, 默认值:是,选项:是/否
use_karras_sigmas
string 
必需
使用 keras sigmas 生成图像。给出了很好的结果, 默认值:是,选项:是/否
algorithm_type
string 
必需
用于 DPMSolverMultistepScheduler 调度程序, 默认值:none,选项:dpmsolver+++
vae
null 
必需
使用自定义 vae 生成图像默认值:null
lora_strength
null 
必需
使用不同的 lora 强度 默认值:null
lora_model
string 
必需
支持多 lora,传递逗号分隔值。对比修复示例,yae-miko-genshin
num_inference_steps
string 
必需
去噪步骤数(最小:1;最大:50)
safety_checker
string 
必需
NSFW 图像检查器。如果检测到此类图像,它将被空白图像替换。
embeddings_model
null 
必需
用它来传递嵌入模型。
enhance_prompt
string 
必需
增强提示以获得更好的结果;默认:是,选项:是/否
multi_lingual
string 
必需
使用与英语不同的语言;默认:是,选项:是/否
controlnet_conditioning_scale
number 
必需
基本上是“guidance_scale”。控制网指导规模。接受 0.1 到 5 之间的浮点值(例如 0.5)
strength
number 
必需
使用init_image时提示强度。1.0 对应于初始化映像中信息的完全破坏。
seed
null 
必需
种子用于重现结果,相同的种子将再次为您提供相同的图像。为随机数传递null 。
webhook
null 
必需
设置 URL 以在图像生成完成后获取 POST API 调用。
track_id
null 
必需
此 ID 在 Webhook API 调用的响应中返回。这将用于识别 Webhook 请求。
clip_skip
string 
必需
如果您想要将给定图像分辨率放大两倍 (2x),请将此参数设置为“yes”。如果请求的分辨率为 512 x 512 像素,则生成的图像将为 1024 x 1024 像素。
guidance_scale
number 
必需
示例

返回响应

🟢200成功
application/json
Body
status
string 
必需
tip
string 
必需
eta
number 
必需
messege
string 
必需
fetch_result
string 
必需
id
integer 
必需
output
string 
必需
meta
object 
必需
prompt
string 
必需
model_id
string 
必需
controlnet_model
string 
必需
controlnet_type
string 
必需
negative_prompt
string 
必需
scheduler
string 
必需
safetychecker
string 
必需
auto_hint
string 
必需
guess_mode
string 
必需
strength
number 
必需
W
integer 
必需
H
integer 
必需
guidance_scale
integer 
必需
seed
integer 
必需
multi_lingual
string 
必需
init_image
string 
必需
mask_image
null 
必需
steps
integer 
必需
full_url
string 
必需
upscale
string 
必需
n_samples
integer 
必需
embeddings
null 
必需
lora
null 
必需
outdir
string 
必需
file_prefix
string 
必需
上一页
概述
下一页
ControlNet 多功能终端
Built with