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