mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-12-09 11:51:16 -08:00
adds components to infotext_fields
allows for loading script params
This commit is contained in:
parent
e57b5f7c55
commit
4d634dc592
2 changed files with 24 additions and 0 deletions
|
|
@ -330,6 +330,20 @@ class ScriptRunner:
|
|||
outputs=[script.group for script in self.selectable_scripts]
|
||||
)
|
||||
|
||||
self.script_load_ctr = 0
|
||||
def onload_script_visibility(params):
|
||||
title = params.get('Script', None)
|
||||
if title:
|
||||
title_index = self.titles.index(title)
|
||||
visibility = title_index == self.script_load_ctr
|
||||
self.script_load_ctr = (self.script_load_ctr + 1) % len(self.titles)
|
||||
return gr.update(visible=visibility)
|
||||
else:
|
||||
return gr.update(visible=False)
|
||||
|
||||
self.infotext_fields.append( (dropdown, lambda x: gr.update(value=x.get('Script', 'None'))) )
|
||||
self.infotext_fields.extend( [(script.group, onload_script_visibility) for script in self.selectable_scripts] )
|
||||
|
||||
return inputs
|
||||
|
||||
def run(self, p: StableDiffusionProcessing, *args):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue