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

Blip 扩散

开发环境
https://stablediffusionapi.com/v1
开发环境
https://stablediffusionapi.com/v1
POST
https://stablediffusionapi.com/api/v5/blip_diffusion
该接口允许您对传递的图像执行 blip 扩散。它最适合对象
POST向 https://stablediffusionapi.com/api/v5/blip_diffusion 接口发出请求,并将所需参数作为请求正文传递到接口。
当任务是时controlnet_generation,请求将如下所示
{
    "key":"",
    "seed":88888,
    "task":"controlnet_generation",
    "prompt":"on a marble table",
    "style_image":"https://m.media-amazon.com/images/I/61qEOpxc1WL.jpg",
    "controlnet_condition_image":"https://m.media-amazon.com/images/I/81ELJHbkafL._AC_SX569_.jpg",
    "style_subject":"teapot",
    "target_subject":"cup",
    "guidance_scale":10,
    "steps":35,
    "height":512,
    "width":512,
    "webhook": null,
    "track_id": null 
}
当任务是时controlnet_scribble_generation,请求将如下所示
{
    "key":"",
    "seed":88888,
    "task":"controlnet_generation",
    "prompt":"on a marble table",
    "style_image":"//huggingface.co/datasets/ayushtues/blipdiffusion_images/resolve/main/flower.jpg",
    "controlnet_condition_image":"https://huggingface.co/lllyasviel/sd-controlnet-scribble/resolve/main/images/bag.png",
    "style_subject":"flower",
    "target_subject":"bag",
    "guidance_scale":10,
    "steps":35,
    "height":512,
    "width":512,
    "webhook": null,
    "track_id": null 
}
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://stablediffusionapi.com/api/v5/blip_diffusion' \
--header 'Content-Type: application/json' \
--data-raw '{
    "key":"",
    "seed":88888,
    "task":"zeroshot",
    "prompt":"on a marble table",
    "condition_image":"https://m.media-amazon.com/images/I/61qEOpxc1WL.jpg",
    "condition_subject":"teapot",
    "target_subject":"school bag",
    "guidance_scale":7.5,
    "steps":35,
    "height":512,
    "width":512,
    "webhook": null,
    "track_id": null 
}'
响应示例响应示例
{
  "status": "success",
  "generationTime": 3.270559072494507,
  "id": 563,
  "output": [
    "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/9c1e05cc-16f0-4a11-9900-a6edd56586dd.png.png"
  ],
  "meta": {
    "base64": "no",
    "file_prefix": "9c1e05cc-16f0-4a11-9900-a6edd56586dd.png",
    "guidance_scale": 7.5,
    "height": 512,
    "instant_response": "no",
    "neg_prompt": "over-exposure, under-exposure, saturated, duplicate, out of frame, lowres, cropped, worst quality, low quality, jpeg artifacts, morbid, mutilated, out of frame, ugly, bad anatomy, bad proportions, deformed, blurry, duplicate",
    "num_inference_steps": 35,
    "outdir": "out",
    "prompt": "on a marble table",
    "prompt_reps": 20,
    "prompt_strength": 1,
    "reference_image": "https://m.media-amazon.com/images/I/61qEOpxc1WL.jpg",
    "seed": 88888,
    "source_subject_category": "teapot",
    "sub_task": "zeroshot",
    "target_subject_category": "shoe",
    "temp": "no",
    "width": 512
  }
}

请求参数

Body 参数application/json
key
string 
必需
您用于请求授权的 API Key
seed
integer 
必需
种子用于重现结果,相同的种子将再次为您提供相同的图像。为随机数传递null 。
task
string 
必需
要执行的任务。它接受zeroshot,controlnet_generation和controlnet_scribble_generation. 默认为“零射击
prompt
string 
必需
文本提示,包含您想要在图像中生成的内容的描述
condition_image
string 
必需
任务 执行时需要zeroshot
condition_subject
string 
必需
当任务 为 时需要zeroshot。它是条件图像中的主题
target_subject
string 
反对结果的预期
必需
guidance_scale
number 
必需
选修的。无分类器指导的量表(最小值:1;最大值:20)。默认为8
steps
integer 
必需
去噪步骤数(最小:1;最大:50)默认为20
height
integer 
必需
最大高度: 高度:512 x 512
width
integer 
必需
最大高度: 宽度: 512 x 512
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 
必需
base64
string 
必需
file_prefix
string 
必需
guidance_scale
number 
必需
height
integer 
必需
instant_response
string 
必需
neg_prompt
string 
必需
num_inference_steps
integer 
必需
outdir
string 
必需
prompt
string 
必需
prompt_reps
integer 
必需
prompt_strength
integer 
必需
reference_image
string 
必需
seed
integer 
必需
source_subject_category
string 
必需
sub_task
string 
必需
target_subject_category
string 
必需
temp
string 
必需
width
integer 
必需
上一页
外部绘画
下一页
魔术混合接口
Built with