aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorLearwin <6223515+Learwin@users.noreply.github.com>2023-12-30 21:52:27 +0100
committerLearwin <6223515+Learwin@users.noreply.github.com>2023-12-30 21:52:27 +0100
commitbc5ae74c7d8949bab37e260b16e76889b9968099 (patch)
tree8bd498b7cceb850cd5a9ba461bf4cd9eba43696b /modules
parent8100e901ab0c5b04d289eebb722c8a653b8beef1 (diff)
Added negative prompts to extra networks lora
Diffstat (limited to 'modules')
-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 ''