diff options
author | hako-mikan <122196982+hako-mikan@users.noreply.github.com> | 2023-11-09 12:57:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 12:57:57 +0000 |
commit | 816096e642187a18b11e2729c42c0b5f677f047d (patch) | |
tree | 8127b07b946b376d4276e2169ceffb7c2e64ba09 /modules/scripts.py | |
parent | 6b9795849d497b41514aa9462690cf7c2802e4f6 (diff) | |
parent | 5e80d9ee99c5899e5e2b130408ffb65a0585a62a (diff) | |
download | stable-diffusion-webui-gfx803-816096e642187a18b11e2729c42c0b5f677f047d.tar.gz stable-diffusion-webui-gfx803-816096e642187a18b11e2729c42c0b5f677f047d.tar.bz2 stable-diffusion-webui-gfx803-816096e642187a18b11e2729c42c0b5f677f047d.zip |
Merge branch 'dev' into master
Diffstat (limited to 'modules/scripts.py')
-rw-r--r-- | modules/scripts.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/scripts.py b/modules/scripts.py index e8518ad0..5c6e0226 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -491,11 +491,15 @@ class ScriptRunner: arg_info = api_models.ScriptArg(label=control.label or "")
- for field in ("value", "minimum", "maximum", "step", "choices"):
+ for field in ("value", "minimum", "maximum", "step"):
v = getattr(control, field, None)
if v is not None:
setattr(arg_info, field, v)
+ choices = getattr(control, 'choices', None) # as of gradio 3.41, some items in choices are strings, and some are tuples where the first elem is the string
+ if choices is not None:
+ arg_info.choices = [x[0] if isinstance(x, tuple) else x for x in choices]
+
api_args.append(arg_info)
script.api_info = api_models.ScriptInfo(
|