aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ui_extra_networks.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-12-31 19:32:28 +0000
committerGitHub <noreply@github.com>2023-12-31 19:32:28 +0000
commitf3af8c8d04d6be58ddb3b55f77d8006241dca8f6 (patch)
tree373634e983739f87cef4f99e90aff039a78a753c /modules/ui_extra_networks.py
parenta84e842189f5599fd354147f72d1a9b9ed0716c8 (diff)
parentb6f74e936e4de3b8d190bffaf3bed67d6d4bd211 (diff)
downloadstable-diffusion-webui-gfx803-f3af8c8d04d6be58ddb3b55f77d8006241dca8f6.tar.gz
stable-diffusion-webui-gfx803-f3af8c8d04d6be58ddb3b55f77d8006241dca8f6.tar.bz2
stable-diffusion-webui-gfx803-f3af8c8d04d6be58ddb3b55f77d8006241dca8f6.zip
Merge pull request #14475 from Learwin/negative_prompt
Adding negative prompts to Loras in extra networks
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 fe5d3ba3..b8c02241 100644
--- a/modules/ui_extra_networks.py
+++ b/modules/ui_extra_networks.py
@@ -223,7 +223,10 @@ class ExtraNetworksPage:
onclick = item.get("onclick", None)
if onclick is None:
- onclick = '"' + html.escape(f"""return cardClicked({quote_js(tabname)}, {item["prompt"]}, {"true" if self.allow_negative_prompt else "false"})""") + '"'
+ if "negative_prompt" in item:
+ onclick = '"' + html.escape(f"""return cardClicked({quote_js(tabname)}, {item["prompt"]}, {item["negative_prompt"]}, {"true" if self.allow_negative_prompt else "false"})""") + '"'
+ else:
+ onclick = '"' + html.escape(f"""return cardClicked({quote_js(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 ''