Fix scripts load order

- 1st webui, 2nd extensions-builtin, 3rd extensions
 - to load scripts independent of --data-dir
 - change load order key [x.basedir, x.filename, x.path] to [orderby(x.basedir), x.filename, x.path]

e.g., scripts/xyz_grid.py dependent extentions should loaded later
extensions\sd-webui-controlnet\scripts\xyz_grid_support.py
extensions\sd-webui-additional-networks\scripts\xyz_grid_support.py
This commit is contained in:
sumof2primes 2023-03-23 01:28:09 +09:00
parent 64b7e83823
commit cd3cd0fca0
1 changed files with 1 additions and 1 deletions

View File

@ -247,7 +247,7 @@ def load_scripts():
return priority[key]
return 9999
for scriptfile in sorted(scripts_list, key=lambda x: [orderby(x.basedir), x.filename, x.path]):
for scriptfile in sorted(scripts_list, key=lambda x: [orderby(x.basedir), x]):
try:
if scriptfile.basedir != paths.script_path:
sys.path = [scriptfile.basedir] + sys.path