Skip to content

Commit 30145b3

Browse files
author
Hongbin Huang
committed
chore: sync from origin repo
1 parent e5b9744 commit 30145b3

File tree

1 file changed

+43
-15
lines changed

1 file changed

+43
-15
lines changed

README.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# easyai
1+
# easyai-sdwebui-api
22
API client for AUTOMATIC1111/stable-diffusion-webui
33

4+
45
Supports txt2img, img2img, extra-single-image, extra-batch-images API calls.
56

7+
Tested on AUTOMATIC1111/stable-diffusion-webui v1.2.1 and Mikubill/sd-webui-controlnet v1.1.189
8+
9+
610
API support have to be enabled from webui. Add --api when running webui.
711
It's explained [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/API).
812

@@ -135,6 +139,16 @@ result4.images[0]
135139
result4.images[1]
136140
```
137141

142+
### Async API support
143+
txt2img, img2img, extra_single_image, extra_batch_images support async api call with use_async=True parameter. You need asyncio, aiohttp packages installed.
144+
```
145+
result = await api.txt2img(prompt="cute kitten",
146+
seed=1001,
147+
use_async=True
148+
)
149+
result.image
150+
```
151+
138152
### Scripts support
139153
Scripts from AUTOMATIC1111's Web UI are supported, but there aren't official models that define a script's interface.
140154

@@ -272,9 +286,17 @@ api.get_hypernetworks()
272286
api.get_face_restorers()
273287
api.get_realesrgan_models()
274288
api.get_prompt_styles()
275-
api.get_artist_categories()
276-
api.get_artists()
289+
api.get_artist_categories() # deprecated ?
290+
api.get_artists() # deprecated ?
277291
api.get_progress()
292+
api.get_embeddings()
293+
api.get_cmd_flags()
294+
api.get_scripts()
295+
api.get_memory()
296+
297+
# misc apis
298+
api.interrupt()
299+
api.skip()
278300
```
279301

280302
### Utility methods
@@ -335,18 +357,26 @@ api.controlnet_version()
335357
# api.controlnet_model_list()
336358
```
337359
<pre>
338-
['control_canny-fp16 [e3fe7712]',
339-
'control_depth-fp16 [400750f6]',
340-
'control_hed-fp16 [13fee50b]',
341-
'control_mlsd-fp16 [e3705cfa]',
342-
'control_normal-fp16 [63f96f7c]',
343-
'control_openpose-fp16 [9ca67cc5]',
344-
'control_scribble-fp16 [c508311e]',
345-
'control_seg-fp16 [b9c1cc12]']
360+
['control_v11e_sd15_ip2p [c4bb465c]',
361+
'control_v11e_sd15_shuffle [526bfdae]',
362+
'control_v11f1p_sd15_depth [cfd03158]',
363+
'control_v11p_sd15_canny [d14c016b]',
364+
'control_v11p_sd15_inpaint [ebff9138]',
365+
'control_v11p_sd15_lineart [43d4be0d]',
366+
'control_v11p_sd15_mlsd [aca30ff0]',
367+
'control_v11p_sd15_normalbae [316696f1]',
368+
'control_v11p_sd15_openpose [cab727d4]',
369+
'control_v11p_sd15_scribble [d4ba51ff]',
370+
'control_v11p_sd15_seg [e1f51eb9]',
371+
'control_v11p_sd15_softedge [a8575a2a]',
372+
'control_v11p_sd15s2_lineart_anime [3825e83e]',
373+
'control_v11u_sd15_tile [1f041471]']
346374
</pre>
347375

348-
**Use of ControlNetInterface txt2img/img2img is deprecated.** Please use the txt2img and img2img api with controlnet_units parameter.
349-
376+
```
377+
api.controlnet_version()
378+
api.controlnet_module_list()
379+
```
350380

351381
```
352382
# normal txt2img
@@ -363,8 +393,6 @@ r = api.txt2img(prompt="photo of a beautiful girl", controlnet_units=[unit1])
363393
r.image
364394
```
365395

366-
![cn2](https://user-images.githubusercontent.com/1288793/222315791-c6c480eb-2987-4044-b673-5f2cb6135f87.png)
367-
368396

369397
```
370398
# img2img with multiple ControlNets

0 commit comments

Comments
 (0)