From cd3cd0fca0f109662e783a55d12c26837254f11f Mon Sep 17 00:00:00 2001 From: sumof2primes Date: Thu, 23 Mar 2023 01:28:09 +0900 Subject: [PATCH] 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 --- modules/scripts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/scripts.py b/modules/scripts.py index 935c693c..a8d525bf 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -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