sort and describe all scripts

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2024-11-08 11:32:47 -05:00
parent ba3a32ae47
commit 5de457bb18
28 changed files with 51 additions and 46 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ debug = shared.log.trace if os.environ.get('SD_FACE_DEBUG', None) is not None el
class Script(scripts.Script):
def title(self):
return 'Face'
return 'Face: Multiple ID Transfers'
def show(self, is_img2img):
return True if shared.native else False
@@ -45,7 +45,7 @@ class Script(scripts.Script):
# return signature is array of gradio components
def ui(self, _is_img2img):
with gr.Row():
gr.HTML("<span>&nbsp Face module</span><br>")
gr.HTML("<span>&nbsp Face: Multiple ID Transfers</span><br>")
with gr.Row():
mode = gr.Dropdown(label='Mode', choices=['None', 'FaceID', 'FaceSwap', 'InstantID', 'PhotoMaker'], value='None')
with gr.Group(visible=False) as cfg_faceid:
+3 -1
View File
@@ -352,7 +352,9 @@ class ScriptRunner:
self.selectable_scripts.clear()
auto_processing_scripts = scripts_auto_postprocessing.create_auto_preprocessing_script_data()
for script_class, path, _basedir, _script_module in auto_processing_scripts + scripts_data:
all_scripts = auto_processing_scripts + scripts_data
sorted_scripts = sorted(all_scripts, key=lambda x: x.script_class().title().lower())
for script_class, path, _basedir, _script_module in sorted_scripts:
try:
script = script_class()
script.filename = path
+1 -1
View File
@@ -246,7 +246,7 @@ def create_output_panel(tabname, preview=True, prompt=None, height=None):
# columns are for <576px, <768px, <992px, <1200px, <1400px, >1400px
result_gallery = gr.Gallery(value=[],
label='Output', show_label=False, show_download_button=True, allow_preview=True, container=False, preview=preview,
columns=5, object_fit='scale-down', height=height,
columns=4, object_fit='scale-down', height=height,
elem_id=f"{tabname}_gallery",
)
if prompt is not None: