mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
uniform listdir and use threadpool to index loras
This commit is contained in:
@@ -7,6 +7,7 @@ from installer import setup_logging, args
|
||||
|
||||
|
||||
preloaded = []
|
||||
debug = os.environ.get('SD_SCRIPT_DEBUG', None)
|
||||
|
||||
|
||||
def load_module(path):
|
||||
@@ -20,9 +21,12 @@ def load_module(path):
|
||||
if '/sd-extension-' in path: # safe extensions without stdout intercept
|
||||
module_spec.loader.exec_module(module)
|
||||
else:
|
||||
# stdout = io.StringIO()
|
||||
with contextlib.redirect_stdout(io.StringIO()) as stdout:
|
||||
if debug:
|
||||
module_spec.loader.exec_module(module)
|
||||
stdout = io.StringIO()
|
||||
else:
|
||||
with contextlib.redirect_stdout(io.StringIO()) as stdout:
|
||||
module_spec.loader.exec_module(module)
|
||||
setup_logging() # reset since scripts can hijaack logging
|
||||
for line in stdout.getvalue().splitlines():
|
||||
if len(line) > 0:
|
||||
|
||||
Reference in New Issue
Block a user