aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui_extra_networks.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-03-25 10:01:49 +0000
committerGitHub <noreply@github.com>2023-03-25 10:01:49 +0000
commit6b00d876f723cc7cb202afa2d31a791901d38295 (patch)
treec8d63d4e11fde6256a48bf72950d002094b670d9 /modules/ui_extra_networks.py
parenta03536f21333099799177914003a6fe2948a9377 (diff)
parent38335e1b8fe30ee555a6ddd542898b7db4fce9b1 (diff)
downloadstable-diffusion-webui-gfx803-6b00d876f723cc7cb202afa2d31a791901d38295.tar.gz
stable-diffusion-webui-gfx803-6b00d876f723cc7cb202afa2d31a791901d38295.tar.bz2
stable-diffusion-webui-gfx803-6b00d876f723cc7cb202afa2d31a791901d38295.zip
Merge pull request #7936 from EllangoK/master
Custom height and width settings for Extra Networks cards
Diffstat (limited to 'modules/ui_extra_networks.py')
-rw-r--r--modules/ui_extra_networks.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py
index 8418147b..daea03d6 100644
--- a/modules/ui_extra_networks.py
+++ b/modules/ui_extra_networks.py
@@ -147,13 +147,16 @@ class ExtraNetworksPage:
if onclick is None:
onclick = '"' + html.escape(f"""return cardClicked({json.dumps(tabname)}, {item["prompt"]}, {"true" if self.allow_negative_prompt else "false"})""") + '"'
+ 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 ''
metadata_button = ""
metadata = item.get("metadata")
if metadata:
metadata_button = f"<div class='metadata-button' title='Show metadata' onclick='extraNetworksRequestMetadata(event, {json.dumps(self.name)}, {json.dumps(item['name'])})'></div>"
args = {
- "preview_html": "style='background-image: url(\"" + html.escape(preview) + "\")'" if preview else '',
+ "style": f"'{height}{width}{background_image}'",
"prompt": item.get("prompt", None),
"tabname": json.dumps(tabname),
"local_preview": json.dumps(item["local_preview"]),