diff options
author | EllangoK <karun.ellango7@gmail.com> | 2023-02-19 19:38:22 +0000 |
---|---|---|
committer | EllangoK <karun.ellango7@gmail.com> | 2023-02-19 19:38:22 +0000 |
commit | ca2b8faa83076a21dd14c974f03f88eb6da57485 (patch) | |
tree | 2abf8f265f35d2567e4be6bb03e39258f0cbc185 /modules/ui_extra_networks.py | |
parent | e452facef476342af30ab7c0d510f715c6ae9ea0 (diff) | |
download | stable-diffusion-webui-gfx803-ca2b8faa83076a21dd14c974f03f88eb6da57485.tar.gz stable-diffusion-webui-gfx803-ca2b8faa83076a21dd14c974f03f88eb6da57485.tar.bz2 stable-diffusion-webui-gfx803-ca2b8faa83076a21dd14c974f03f88eb6da57485.zip |
custom height, width settings for extra networks
Diffstat (limited to 'modules/ui_extra_networks.py')
-rw-r--r-- | modules/ui_extra_networks.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index 71f1d81f..0c7ba173 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -124,8 +124,12 @@ 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}em;" if shared.opts.extra_networks_card_height else ''
+ width = f"width: {shared.opts.extra_networks_card_width}em;" if shared.opts.extra_networks_card_width else ''
+ background_image = f"background-image: url(\"{html.escape(preview)}\");" if preview else ''
+
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"]),
|