Updated ControlNet Web API (markdown)

Chenlei Hu
2024-02-10 13:43:39 -05:00
parent 4417e2989a
commit 4bca29eb31

@@ -1,8 +1,6 @@
This page is a guide on how to use ControlNet's Web API.
You need to pass parameters to ControlNet script, when you use [A1111's txt2img/img2img generation API](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API).
## List all available preprocessors example
## List all available preprocessors
```python
modules = requests.get("http://localhost:7860/controlnet/module_list").json()["module_list"]
"""
@@ -20,7 +18,7 @@ modules = requests.get("http://localhost:7860/controlnet/module_list").json()["m
"""
```
## List all available models example
## List all available models
```python
modules = requests.get("http://localhost:7860/controlnet/model_list").json()["model_list"]
"""
@@ -35,7 +33,11 @@ modules = requests.get("http://localhost:7860/controlnet/model_list").json()["mo
"""
```
## Generation (txt2img) example
## Generation (txt2img)
You need to pass parameters to ControlNet script, when you use [A1111's txt2img/img2img generation API](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API).
You may find https://github.com/huchenlei/sd-webui-api-payload-display helpful to reproduce the an UI result via API.
```python
import base64
import cv2