diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-12 06:07:49 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-12 06:07:49 +0000 |
commit | c15c3b08df7690670f15f5f5a86ca20b6918cd41 (patch) | |
tree | b89622819db4f794f8c03632a6b5936131436428 | |
parent | fd07b103aeb70a80e3641068e483475e32c9750c (diff) | |
parent | 6d408c06c634cc96480f055941754dcc43f781d9 (diff) | |
download | stable-diffusion-webui-gfx803-c15c3b08df7690670f15f5f5a86ca20b6918cd41.tar.gz stable-diffusion-webui-gfx803-c15c3b08df7690670f15f5f5a86ca20b6918cd41.tar.bz2 stable-diffusion-webui-gfx803-c15c3b08df7690670f15f5f5a86ca20b6918cd41.zip |
Merge pull request #2312 from AUTOMATIC1111/edit-attention-nan-fix
edit attention key handler: return early when weight parse returns NaN
-rw-r--r-- | javascript/edit-attention.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/javascript/edit-attention.js b/javascript/edit-attention.js index 79566a2e..3f1d2fbb 100644 --- a/javascript/edit-attention.js +++ b/javascript/edit-attention.js @@ -25,6 +25,7 @@ addEventListener('keydown', (event) => { } else {
end = target.value.slice(selectionEnd + 1).indexOf(")") + 1;
weight = parseFloat(target.value.slice(selectionEnd + 1, selectionEnd + 1 + end));
+ if (isNaN(weight)) return;
if (event.key == minus) weight -= 0.1;
if (event.key == plus) weight += 0.1;
|