thread safe extra network using list

This commit is contained in:
w-e-w 2023-09-09 17:05:50 +09:00
parent 25de9a785c
commit f5959c1c30
3 changed files with 6 additions and 3 deletions

View File

@ -66,7 +66,8 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
return item
def list_items(self):
for index, name in enumerate(networks.available_networks):
names = list(networks.available_networks)
for index, name in enumerate(names):
item = self.create_item(name, index)
if item is not None:

View File

@ -31,7 +31,8 @@ class ExtraNetworksPageHypernetworks(ui_extra_networks.ExtraNetworksPage):
}
def list_items(self):
for index, name in enumerate(shared.hypernetworks):
names = list(shared.hypernetworks)
for index, name in enumerate(names):
yield self.create_item(name, index)
def allowed_directories_for_previews(self):

View File

@ -29,7 +29,8 @@ class ExtraNetworksPageTextualInversion(ui_extra_networks.ExtraNetworksPage):
}
def list_items(self):
for index, name in enumerate(sd_hijack.model_hijack.embedding_db.word_embeddings):
names = list(sd_hijack.model_hijack.embedding_db.word_embeddings)
for index, name in enumerate(names):
yield self.create_item(name, index)
def allowed_directories_for_previews(self):