Remove remains of priority logic

This commit is contained in:
Sergey Borisov 2024-07-13 00:44:21 +03:00
parent 7e00526999
commit e961dd1dec
2 changed files with 3 additions and 6 deletions

View File

@ -27,8 +27,7 @@ def callback(name: str, order: int = 0):
class ExtensionBase:
def __init__(self, priority: int):
self.priority = priority
def __init__(self):
self.injections: List[InjectionInfo] = []
for func_name in dir(self):
func = getattr(self, func_name)

View File

@ -81,11 +81,10 @@ class ExtensionsManager:
def add_extension(self, ext: ExtensionBase):
self.extensions.append(ext)
ordered_extensions = sorted(self.extensions, reverse=True, key=lambda ext: ext.priority)
self._callbacks.clear()
for ext in ordered_extensions:
for ext in self.extensions:
for inj_info in ext.injections:
if inj_info.type == "callback":
if inj_info.name not in self._callbacks:
@ -139,8 +138,7 @@ class ExtensionsManager:
changed_keys = set()
changed_unknown_keys = {}
ordered_extensions = sorted(self.extensions, reverse=True, key=lambda ext: ext.priority)
for ext in ordered_extensions:
for ext in self.extensions:
patch_result = exit_stack.enter_context(ext.patch_unet(state_dict, unet))
if patch_result is None:
continue