diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-05-18 20:23:13 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-18 20:23:13 +0000 |
commit | 3d959f5b494f010300a3a4607dc1acf2a6e2fc16 (patch) | |
tree | 54698e379f57821c55a8cedfdaf7e547fae88e02 /modules/ui_extra_networks.py | |
parent | 6837cf6a8d14feb3084301986ae558d86fd8de0d (diff) | |
parent | 8410b1351e2fb2cf6e29925e06c2f0e51ce7852d (diff) | |
download | stable-diffusion-webui-gfx803-3d959f5b494f010300a3a4607dc1acf2a6e2fc16.tar.gz stable-diffusion-webui-gfx803-3d959f5b494f010300a3a4607dc1acf2a6e2fc16.tar.bz2 stable-diffusion-webui-gfx803-3d959f5b494f010300a3a4607dc1acf2a6e2fc16.zip |
Merge remote-tracking branch 'missionfloyd/extra-network-preview-lazyload' into dev
Diffstat (limited to 'modules/ui_extra_networks.py')
-rw-r--r-- | modules/ui_extra_networks.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 8bd0722e..80cfa841 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -161,7 +161,7 @@ class ExtraNetworksPage: height = f"height: {shared.opts.extra_networks_card_height}px;" if shared.opts.extra_networks_card_height else ''
width = f"width: {shared.opts.extra_networks_card_width}px;" if shared.opts.extra_networks_card_width else ''
- background_image = f"background-image: url(\"{html.escape(preview)}\");" if preview else ''
+ background_image = f'<img src="{html.escape(preview)}" class="preview" loading="lazy">' if preview else ''
metadata_button = ""
metadata = item.get("metadata")
if metadata:
@@ -186,7 +186,8 @@ class ExtraNetworksPage: return ""
args = {
- "style": f"'display: none; {height}{width}{background_image}'",
+ "background_image": background_image,
+ "style": f"'display: none; {height}{width}'",
"prompt": item.get("prompt", None),
"tabname": json.dumps(tabname),
"local_preview": json.dumps(item["local_preview"]),
|