aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-02 00:30:49 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-09-02 00:30:49 +0300
commitb90feb02aa87dc5456542f1e8ba70a1526037387 (patch)
treedfb3c2510b18c184086667da26dcef412dfc91a7
parent0a85f1afff3be95b1708191eaa4de2ce66feac63 (diff)
option to disable ((())) and [[[]]]
-rw-r--r--webui.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/webui.py b/webui.py
index fbe76d11..2b465396 100644
--- a/webui.py
+++ b/webui.py
@@ -229,6 +229,7 @@ class Options:
"enable_pnginfo": OptionInfo(True, "Save text information about generation parameters as chunks to png files"),
"font": OptionInfo("arial.ttf", "Font for image grids that have text"),
"prompt_matrix_add_to_start": OptionInfo(True, "In prompt matrix, add the variable combination of text to the start of the prompt, rather than the end"),
+ "enable_emphasis": OptionInfo(True, "Use (text) to make model pay more attention to text text and [text] to make it pay less attention")
}
def __init__(self):
@@ -702,7 +703,7 @@ class StableDiffusionModelHijack:
word_embeddings = {}
word_embeddings_checksums = {}
fixes = None
- comments = None
+ comments = []
dir_mtime = None
def load_textual_inversion_embeddings(self, dirname, model):
@@ -810,7 +811,7 @@ class FrozenCLIPEmbedderWithCustomWords(torch.nn.Module):
possible_matches = self.hijack.ids_lookup.get(token, None)
- mult_change = self.token_mults.get(token)
+ mult_change = self.token_mults.get(token) if opts.enable_emphasis else None
if mult_change is not None:
mult *= mult_change
elif possible_matches is None:
@@ -2001,7 +2002,7 @@ else:
sd_model = sd_model.to(device)
model_hijack = StableDiffusionModelHijack()
-#model_hijack.hijack(sd_model)
+model_hijack.hijack(sd_model)
with open(os.path.join(script_path, "style.css"), "r", encoding="utf8") as file:
css = file.read()