1、开启api调用模式
开启api模式,关闭可视化窗口,并且建议关闭登录权限(详细查看文章最后Stable Diffusion之Ubuntu下部署-CSDN博客)
./webui.sh –disable-safe-unpickle –api –nowebui
2、查看接口列表
访问对应的网页地址 http://192.168.xx.xx:7860/docs#

3、text2img接口调用
#接口地址
http://192.168.xx.xx:9876/sdapi/v1/txt2img
参数内容
application/json
batch_size 生成批次个数
{
"batch_size": 1,
"cfg_scale": 7,
"negative_prompt": "NSFW",
"override_settings": {
"sd_model_checkpoint": "anythingv5nijimix_25BEST.safetensors [8bc735ed57]"
},
"clip_skip": 1,
"prompt": "full body, a girl, blue hand, Long yellow hair, blue shoes, write background, 20240320-1710939437372:1>
20240320-1710939437372:1>20240320-1710939437372:1>20240320-1710939437372:1>20240320-1710939437372:1>
文章来源于互联网:Stable Diffusion之API接口调用
5bei.cn大模型教程网











