Fix loading extensions from within the interface

This commit is contained in:
oobabooga 2023-03-28 23:27:02 -03:00 committed by GitHub
parent 304f812c63
commit 1edfb96778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ import modules.shared as shared
state = {} state = {}
available_extensions = [] available_extensions = []
setup_called = False setup_called = set()
def load_extensions(): def load_extensions():
global state global state
@ -53,13 +53,12 @@ def create_extensions_block():
should_display_ui = False should_display_ui = False
# Running setup function # Running setup function
if not setup_called: for extension, name in iterator():
for extension, name in iterator(): if hasattr(extension, "ui"):
if hasattr(extension, "setup"): should_display_ui = True
extension.setup() if extension not in setup_called and hasattr(extension, "setup"):
if hasattr(extension, "ui"): setup_called.add(extension)
should_display_ui = True extension.setup()
setup_called = True
# Creating the extension ui elements # Creating the extension ui elements
if should_display_ui: if should_display_ui: