mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-03-09 23:44:55 +08:00
performance optimization for extra networks
This commit is contained in:
parent
8b96f3d036
commit
e0c9361b7d
@ -489,15 +489,15 @@ class ExtraNetworksPage:
|
||||
Returns:
|
||||
HTML formatted string.
|
||||
"""
|
||||
res = ""
|
||||
res = []
|
||||
for item in self.items.values():
|
||||
res += self.create_item_html(tabname, item, self.card_tpl)
|
||||
res.append(self.create_item_html(tabname, item, self.card_tpl))
|
||||
|
||||
if res == "":
|
||||
if not res:
|
||||
dirs = "".join([f"<li>{x}</li>" for x in self.allowed_directories_for_previews()])
|
||||
res = none_message or shared.html("extra-networks-no-cards.html").format(dirs=dirs)
|
||||
res = [none_message or shared.html("extra-networks-no-cards.html").format(dirs=dirs)]
|
||||
|
||||
return res
|
||||
return "".join(res)
|
||||
|
||||
def create_html(self, tabname, *, empty=False):
|
||||
"""Generates an HTML string for the current pane.
|
||||
|
Loading…
Reference in New Issue
Block a user