mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
Warning when Script is not found
This commit is contained in:
parent
a976f4dff9
commit
600f339c4c
@ -739,11 +739,16 @@ class ScriptRunner:
|
|||||||
def onload_script_visibility(params):
|
def onload_script_visibility(params):
|
||||||
title = params.get('Script', None)
|
title = params.get('Script', None)
|
||||||
if title:
|
if title:
|
||||||
|
try:
|
||||||
title_index = self.titles.index(title)
|
title_index = self.titles.index(title)
|
||||||
visibility = title_index == self.script_load_ctr
|
visibility = title_index == self.script_load_ctr
|
||||||
self.script_load_ctr = (self.script_load_ctr + 1) % len(self.titles)
|
self.script_load_ctr = (self.script_load_ctr + 1) % len(self.titles)
|
||||||
return gr.update(visible=visibility)
|
return gr.update(visible=visibility)
|
||||||
else:
|
except ValueError:
|
||||||
|
params['Script'] = None
|
||||||
|
massage = f'Cannot find Script: "{title}"'
|
||||||
|
print(massage)
|
||||||
|
gr.Warning(massage)
|
||||||
return gr.update(visible=False)
|
return gr.update(visible=False)
|
||||||
|
|
||||||
self.infotext_fields.append((dropdown, lambda x: gr.update(value=x.get('Script', 'None'))))
|
self.infotext_fields.append((dropdown, lambda x: gr.update(value=x.get('Script', 'None'))))
|
||||||
|
Loading…
Reference in New Issue
Block a user