Update gradio_compile.py

This commit is contained in:
lllyasviel
2024-01-25 22:24:20 -08:00
parent e1951339f0
commit 04f50e1ba4

View File

@@ -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