mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-03 22:58:58 +00:00
allow extensions to sort themselves in UI
and other installed extensions will be on top now (including some resolution related UI extensions)
This commit is contained in:
@@ -94,6 +94,9 @@ class Script:
|
||||
controls = None
|
||||
"""A list of controls retured by the ui()."""
|
||||
|
||||
sorting_priority = 0
|
||||
"""Larger number will appear downwards in the UI."""
|
||||
|
||||
def title(self):
|
||||
"""this function should return the title of the script. This is what will be displayed in the dropdown menu."""
|
||||
|
||||
@@ -695,6 +698,8 @@ class ScriptRunner:
|
||||
if scriptlist is None:
|
||||
scriptlist = self.alwayson_scripts
|
||||
|
||||
scriptlist = sorted(scriptlist, key=lambda x: x.sorting_priority)
|
||||
|
||||
for script in scriptlist:
|
||||
if script.alwayson and script.section != section:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user