diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-10-15 07:12:38 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-10-15 07:12:38 +0000 |
commit | 2f6ea8b10312e700f8d01f90dff15d17690ce49c (patch) | |
tree | 408ab95f50f0f12dde8f7c6d033c8a071e3f259a /javascript/edit-attention.js | |
parent | a3d9b011a3e97024788957bdc83a9c8ee3014bef (diff) | |
download | stable-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
Diffstat (limited to 'javascript/edit-attention.js')
-rw-r--r-- | javascript/edit-attention.js | 2 |
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; |