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

Controlnet

开发环境
https://stablediffusionapi.com/v1
开发环境
https://stablediffusionapi.com/v1
POST
https://stablediffusionapi.com/api/v1/enterprise/controlnet
该端点用于生成 ControlNet 图像。
提示
您还可以使用此端点通过 ControlNet 修复图像。只需确保将链接传递到mask_image请求正文中即可。并使用 controlnet_model 作为“修复”
POST向 https://stablediffusionapi.com/api/v1/enterprise/controlnet 接口发送请求。
信息
要使用负载平衡器,您需要拥有1 台以上的服务器。传递第一台服务器的 API 密钥,它将处理与其他服务器的负载平衡。
提示
您也可以使用多 ControlNet 模型。只需确保在 controlnet_model参数中以逗号分隔传入多个模型,例如 "canny,depth",并在请求体中传入 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 - 人脸检测

调度程序#

该端点还支持调度程序。使用请求正文中的“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/v1/enterprise/controlnet' \
--header 'Content-Type: application/json' \
--data-raw '{
  "key": "enterprise_api_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/datasets/diffusers/test-arrays/resolve/main/stable_diffusion_imgvar/input_image_vermeer.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,
  "strength": 0.55,
  "seed": null,
  "webhook": null,
  "track_id": null
}'
响应示例响应示例
{
  "status": "string",
  "generationTime": 0,
  "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 
链接到初始图像
必需
control_image
string 
必需
链接到 Controlnet 图像
mask_image
null 
必需
链接到用于修复的蒙版图像
width
string 
必需
最大高度: 宽度: 1024x1024
height
string 
必需
最大高度: 宽度: 1024x1024
samples
string 
必需
作为响应返回的图像数量。最大值为 4。
scheduler
string 
必需
用它来设置调度程序。
tomesd
string 
必需
启用 tomesd 生成图像:给出非常快的结果, 默认值:是,选项:是/否
use_karras_sigmas
string 
必需
使用 keras sigmas 生成图像。给出了很好的结果, 默认值:是,选项:是/否
num_inference_steps
string 
必需
去噪步骤数(最小:1;最大:50)
safety_checker
string 
必需
NSFW 图像检查器。如果检测到此类图像,它将被空白图像替换。
enhance_prompt
string 
必需
用它来传递嵌入模型。
guidance_scale
number 
必需
无分类器指导的量表(最小值:1;最大值:20)
strength
number 
必需
使用init_image时提示强度。1.0 对应于初始化映像中信息的完全破坏。
seed
null 
必需
种子用于重现结果,相同的种子将再次为您提供相同的图像。为随机数传递null 。
webhook
null 
必需
设置 URL 以在图像生成完成后获取 POST API 调用。
track_id
null 
必需
此 ID 在 Webhook API 调用的响应中返回。这将用于识别 Webhook 请求。
示例

返回响应

🟢200成功
application/json
Body
status
string 
必需
generationTime
number 
必需
id
integer 
必需
output
array[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 
必需
上一页
删除模型
下一页
文字转图像
Built with