diff --git a/modules/extensions.py b/modules/extensions.py index 1094fc4d..1a936aa6 100644 --- a/modules/extensions.py +++ b/modules/extensions.py @@ -4,6 +4,16 @@ import modules.shared as shared extension_state = {} available_extensions = [] +def load_extensions(): + global extension_state + for i,ext in enumerate(shared.args.extensions.split(',')): + if ext in available_extensions: + print(f'Loading the extension "{ext}"... ', end='') + ext_string = f"extensions.{ext}.script" + exec(f"import {ext_string}") + extension_state[ext] = [True, i] + print(f'Ok.') + def apply_extensions(text, typ): for ext in sorted(extension_state, key=lambda x : extension_state[x][1]): if extension_state[ext][0] == True: @@ -26,15 +36,5 @@ def update_extensions_parameters(*kwargs): params[param] = eval(f"kwargs[{i}]") i += 1 -def load_extensions(): - global extension_state - for i,ext in enumerate(shared.args.extensions.split(',')): - if ext in available_extensions: - print(f'Loading the extension "{ext}"... ', end='') - ext_string = f"extensions.{ext}.script" - exec(f"import {ext_string}") - extension_state[ext] = [True, i] - print(f'Ok.') - def get_params(name): return eval(f"extensions.{name}.script.params")