From 04f50e1ba49512a075d61c22f080995671db35b0 Mon Sep 17 00:00:00 2001 From: lllyasviel Date: Thu, 25 Jan 2024 22:24:20 -0800 Subject: [PATCH] Update gradio_compile.py --- modules_forge/gradio_compile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules_forge/gradio_compile.py b/modules_forge/gradio_compile.py index aaf1812b..33a57314 100644 --- a/modules_forge/gradio_compile.py +++ b/modules_forge/gradio_compile.py @@ -1,5 +1,13 @@ def gradio_compile(items, prefix): for k, v in items["required"].items(): - a = 0 + if len(v) == 2: + t, d = v + if t == 'INT': + name = prefix + '_' + k + default = int(d['default']) + min = int(d['min']) + max = int(d['max']) + step = int(d.get('step', 1)) + print(f'{name} = gr.Slider(label=\'{name}\', minimum={min}, maximum={max}, step={step}, value={default})') return