diff options
author | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2024-01-01 06:47:57 +0000 |
---|---|---|
committer | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2024-01-01 06:47:57 +0000 |
commit | 00901bfbe0095303554f4440b4c12fac262e2e89 (patch) | |
tree | 18c6a576c19d085e365ae549c6fc3aee71e1e51b /modules | |
parent | a70dfb64a86b9b6d869deffdb0ffebe980365473 (diff) | |
download | stable-diffusion-webui-gfx803-00901bfbe0095303554f4440b4c12fac262e2e89.tar.gz stable-diffusion-webui-gfx803-00901bfbe0095303554f4440b4c12fac262e2e89.tar.bz2 stable-diffusion-webui-gfx803-00901bfbe0095303554f4440b4c12fac262e2e89.zip |
handle selectable script_index is None
Diffstat (limited to 'modules')
-rw-r--r-- | modules/scripts.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/scripts.py b/modules/scripts.py index 3a766911..017aed5a 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -696,6 +696,8 @@ class ScriptRunner: self.setup_ui_for_section(None, self.selectable_scripts)
def select_script(script_index):
+ if script_index is None:
+ script_index = 0
selected_script = self.selectable_scripts[script_index - 1] if script_index>0 else None
return [gr.update(visible=selected_script == s) for s in self.selectable_scripts]
@@ -739,7 +741,7 @@ class ScriptRunner: def run(self, p, *args):
script_index = args[0]
- if script_index == 0:
+ if script_index == 0 or script_index is None:
return None
script = self.selectable_scripts[script_index-1]
|