aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-10-15 07:12:38 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-10-15 07:12:38 +0000
commit2f6ea8b10312e700f8d01f90dff15d17690ce49c (patch)
tree408ab95f50f0f12dde8f7c6d033c8a071e3f259a
parenta3d9b011a3e97024788957bdc83a9c8ee3014bef (diff)
downloadstable-diffusion-webui-gfx803-2f6ea8b10312e700f8d01f90dff15d17690ce49c.tar.gz
stable-diffusion-webui-gfx803-2f6ea8b10312e700f8d01f90dff15d17690ce49c.tar.bz2
stable-diffusion-webui-gfx803-2f6ea8b10312e700f8d01f90dff15d17690ce49c.zip
respect keyedit_precision_attention setting when converting from old (((attention))) syntax
-rw-r--r--javascript/edit-attention.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/javascript/edit-attention.js b/javascript/edit-attention.js
index 8b6dd240..45d9a788 100644
--- a/javascript/edit-attention.js
+++ b/javascript/edit-attention.js
@@ -86,6 +86,8 @@ function keyupEditAttention(event) {
weight = (1 / 1.1) ** numParen;
}
+ weight = Math.round(weight / opts.keyedit_precision_attention) * opts.keyedit_precision_attention;
+
text = text.slice(0, selectionStart - numParen) + "(" + text.slice(selectionStart, selectionEnd) + ":" + weight + ")" + text.slice(selectionEnd + numParen);
selectionStart -= numParen - 1;
selectionEnd -= numParen - 1;