Commit b13806c1 authored by AUTOMATIC1111's avatar AUTOMATIC1111

fix a bug preventing normal operation if a string is added to a gr.Number...

fix a bug preventing normal operation if a string is added to a gr.Number component via ui-config.json
parent 4f6582cb
......@@ -50,6 +50,8 @@ class UiLoadsave:
else:
if isinstance(x, gr.Textbox) and field == 'value': # due to an undersirable behavior of gr.Textbox, if you give it an int value instead of str, everything dies
saved_value = str(saved_value)
elif isinstance(x, gr.Number) and field == 'value':
saved_value = float(saved_value)
setattr(obj, field, saved_value)
if init_field is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment