mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-04-30 00:39:04 +08:00
performance optimization for extra networks
This commit is contained in:
parent
8b96f3d036
commit
e0c9361b7d
@ -489,15 +489,15 @@ class ExtraNetworksPage:
|
|||||||
Returns:
|
Returns:
|
||||||
HTML formatted string.
|
HTML formatted string.
|
||||||
"""
|
"""
|
||||||
res = ""
|
res = []
|
||||||
for item in self.items.values():
|
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()])
|
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):
|
def create_html(self, tabname, *, empty=False):
|
||||||
"""Generates an HTML string for the current pane.
|
"""Generates an HTML string for the current pane.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user