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

Lora 模型

开发环境
https://stablediffusionapi.com/v1
开发环境
https://stablediffusionapi.com/v1
POST
https://stablediffusionapi.com/api/v3/lora_fine_tune
使用此接口,您可以使用自己的图像训练 Lora 模型。您可以在任何物体或人上训练模型。

训练类型#

下表列出了该training_type参数的所有可能值。
价值描述
men在男人的脸上进行训练。
femal在女性脸上进行训练。
couple对男女情侣进行训练;在图像数组中传递情侣的图像,而不是单个人的图像。
null在物体或任何东西上进行训练。

Webhook 发布JSON#

这是 JSON 格式的 Webhook post 调用示例。
{
 "status": "success",
 "training_status": "deploying_gpu",
 "logs": "it will take upto 25 minutes",
 "model_id": "F5jvdzGnYi",
}

训练状态值#

下表描述了所有可能的训练状态。
地位描述
deploying_gpu部署GPU
training_started培训开始
training_success培训顺利完成
trained_model_compressing压缩训练好的模型
trained_model_uploading上传训练好的模型
trained_model_uploaded训练好的模型已上传
deploying_model部署经过训练的模型
model_ready训练好的模型可供使用
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://stablediffusionapi.com/api/v3/lora_fine_tune' \
--header 'Content-Type: application/json' \
--data-raw '{
    "key":"",
    "instance_prompt": "photo of ambika0 man",
    "class_prompt": "photo of a man",
    "base_model_type": "sdxl",
    "negative_prompt":" lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
    "images": [
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/1.png",
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/2.png",
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/3.png",
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/4.png",
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/5.png",
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/6.png",
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/7.png",
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/8.png",
    "https://raw.githubusercontent.com/pnavitha/sampleImages/master/9.png"
  ],
    "seed": "0",
    "training_type": "men",
    "max_train_steps": "2",
    "lora_type":"lora",
    "webhook": null
}'
响应示例响应示例
{
  "status": "success",
  "messege": "deploying_gpu",
  "data": "it will take upto 30 minutes.",
  "training_id": "F5jvdzGnYi"
}

请求参数

Body 参数application/json
key
string 
必需
您用于请求授权的 API Key
instance_prompt
string 
必需
文本提示,说明您想如何称呼受过训练的人/物体
class_prompt
string 
必需
受训人员/物体的分类
base_model_type
string 
必需
您想要训练的 lora 基础模型的类型。它接受 normal或 sdxl
negative_prompt
string 
必需
图像中您不想要的项目
images
array[string]
必需
传递可访问的图像直接链接,裁剪为 512 x 512 像素。一个好的数字是 7-8 张图像。
seed
string 
必需
training_type
string 
必需
您正在训练的对象的类型
max_train_steps
string 
必需
设置为图像数量的2倍(N i *2;最大值2000)
lora_type
string 
必需
它接受lora或 lycoris
webhook
null 
培训完成后接到电话
必需
示例

返回响应

🟢200成功
application/json
Body
status
string 
必需
messege
string 
必需
data
string 
必需
training_id
string 
必需
上一页
概述
下一页
Dreambooth 模型 (V2)
Built with