From 1edfb9677840b03ce321a450aed87961af24a361 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 28 Mar 2023 23:27:02 -0300 Subject: [PATCH] Fix loading extensions from within the interface --- modules/extensions.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/extensions.py b/modules/extensions.py index c3cf4de4..fe6a3945 100644 --- a/modules/extensions.py +++ b/modules/extensions.py @@ -7,7 +7,7 @@ import modules.shared as shared state = {} available_extensions = [] -setup_called = False +setup_called = set() def load_extensions(): global state @@ -53,13 +53,12 @@ def create_extensions_block(): should_display_ui = False # Running setup function - if not setup_called: - for extension, name in iterator(): - if hasattr(extension, "setup"): - extension.setup() - if hasattr(extension, "ui"): - should_display_ui = True - setup_called = True + for extension, name in iterator(): + if hasattr(extension, "ui"): + should_display_ui = True + if extension not in setup_called and hasattr(extension, "setup"): + setup_called.add(extension) + extension.setup() # Creating the extension ui elements if should_display_ui: