fix some sorting problem

This commit is contained in:
lllyasviel
2023-11-14 23:36:58 -08:00
parent ad1ae0fd48
commit 97a6e87d18
3 changed files with 7 additions and 1 deletions
+2
View File
@@ -31,6 +31,7 @@ def try_load_sorted_styles(style_names, default_selected):
def sort_styles(selected):
global all_styles
unselected = [y for y in all_styles if y not in selected]
sorted_styles = selected + unselected
try:
@@ -39,6 +40,7 @@ def sort_styles(selected):
except Exception as e:
print('Write style sorting failed.')
print(e)
all_styles = sorted_styles
return gr.CheckboxGroup.update(choices=sorted_styles)