opparco / stable-diffusion-webui-two-shot

Latent Couple extension (two shot diffusion port)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any way to pass the Latent couple settings through automatic1111 API?

yiouyou opened this issue · comments

I'm using automatic1111 API to call txt2img/img2img process and would like to take the advantage of Latent couple extension. But have no idea how to pass the settings to the extension through API.

Need some help if possible,
Thanks a lot!

commented

I'm stuck in the same boat, Did you find a solution?

I also want to integrate the functionality of Latent Couple with other applications, but I cannot find any relevant documentation for the Restful API. Does anyone have any clues? Thank you.

commented

It seems I found a way to make it work: in a recent commit "alwayson_scripts" field was added in the API payload options. You can add the name of the extension and list its arguments, like this for example:

"alwayson_scripts": {'Latent Couple extension':{"args":[True,
                                                      "1:1,1:2,1:2",
                                                      "0:0,0:0,0:1",
                                                      "0.5,0.8,0.8",30]}}

To find the arguments and title for the script I had to check the source code,
"title" field in the Script class of the extension source code,
and to get arguments check "process_script_params" function.