Commit Graph

8 Commits

Author SHA1 Message Date
AUTOMATIC1111 23c06a51cc use 'scripts.' prefix for names of dynamically loaded modules 2024-04-06 09:05:04 +03:00
storyicon e73a7e4006 feat: ensure the indexability of dynamically imported packages
Signed-off-by: storyicon <storyicon@foxmail.com>
2024-04-01 09:13:07 +00:00
AUTOMATIC1111 136c8859a4 add backwards compatibility --lyco-dir-backcompat option, use that for LyCORIS directory instead of hardcoded value
prevent running preload.py for disabled extensions
2023-07-18 20:11:30 +03:00
AUTOMATIC 05933840f0 rename print_error to report, use it with together with package name 2023-05-31 19:56:37 +03:00
Aarni Koskela 00dfe27f59 Add & use modules.errors.print_error where currently printing exception info by hand 2023-05-29 09:17:30 +03:00
AUTOMATIC 4b854806d9 F401 fixes for ruff 2023-05-10 09:02:23 +03:00
Max Audron 14c0884fd0 use python importlib to load and execute extension modules
previously module attributes like __file__ where not set correctly,
leading to scripts getting the directory of the stable-diffusion repo
location instead of their own script.

This causes problem when loading user data from an external location
using the --data-dir flag, as extensions would look for their own code
in the stable-diffusion repo location instead of the data dir location.

Using pythons importlib functions sets the modules specs correctly and
executes them. But this will break extensions if they build paths based
on the previously incorrect __file__ attribute.
2023-01-27 14:44:34 +01:00
AUTOMATIC a1a376331c make existing script loading and new preload code use same code for loading modules
limit extension preload scripts to just one file named preload.py
2022-11-12 10:56:06 +03:00