diff options
author | Vespinian <vespinian@proton.me> | 2023-03-29 03:52:51 +0000 |
---|---|---|
committer | Vespinian <vespinian@proton.me> | 2023-03-29 03:52:51 +0000 |
commit | 70a0a11783747d2e77a08a63d9feeceb7d2d4f63 (patch) | |
tree | 2173717cfcf5bb199488fa11d36f3f843579ad12 /modules/api | |
parent | 3856ada5cc9ac4124e20ff311ce7aa77330845d9 (diff) | |
download | stable-diffusion-webui-gfx803-70a0a11783747d2e77a08a63d9feeceb7d2d4f63.tar.gz stable-diffusion-webui-gfx803-70a0a11783747d2e77a08a63d9feeceb7d2d4f63.tar.bz2 stable-diffusion-webui-gfx803-70a0a11783747d2e77a08a63d9feeceb7d2d4f63.zip |
Changed behavior that puts the args from alwayson_script request in the script_args, so don't accidently resize the arg list if we get less arg then or default list has
Diffstat (limited to 'modules/api')
-rw-r--r-- | modules/api/api.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/api/api.py b/modules/api/api.py index 518b2a61..8c5cd185 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -272,7 +272,9 @@ class Api: raise HTTPException(status_code=422, detail=f"Cannot have a selectable script in the always on scripts params") # always on script with no arg should always run so you don't really need to add them to the requests if "args" in request.alwayson_scripts[alwayson_script_name]: - script_args[alwayson_script.args_from:alwayson_script.args_to] = request.alwayson_scripts[alwayson_script_name]["args"] + # min between arg length in scriptrunner and arg length in the request + for idx in range(0, min((alwayson_script.args_to - alwayson_script.args_from), len(request.alwayson_scripts[alwayson_script_name]["args"]))): + script_args[alwayson_script.args_from + idx] = request.alwayson_scripts[alwayson_script_name]["args"][idx] return script_args def text2imgapi(self, txt2imgreq: StableDiffusionTxt2ImgProcessingAPI): |