mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-06 07:05:06 +08:00
fix a bug preventing normal operation if a string is added to a gr.Number component via ui-config.json
This commit is contained in:
parent
4f6582cb66
commit
b13806c150
@ -50,6 +50,8 @@ class UiLoadsave:
|
|||||||
else:
|
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
|
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)
|
saved_value = str(saved_value)
|
||||||
|
elif isinstance(x, gr.Number) and field == 'value':
|
||||||
|
saved_value = float(saved_value)
|
||||||
|
|
||||||
setattr(obj, field, saved_value)
|
setattr(obj, field, saved_value)
|
||||||
if init_field is not None:
|
if init_field is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user