From d6b700483f8bd78786ea0d3d94843035a3600591 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 3 Apr 2024 00:29:34 +0300 Subject: [PATCH] Allow hyphens in SD prompts --- public/scripts/extensions/stable-diffusion/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/extensions/stable-diffusion/index.js b/public/scripts/extensions/stable-diffusion/index.js index f64ba5156..f4e47ca84 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -1808,7 +1808,7 @@ function processReply(str) { str = str.replaceAll('“', ''); str = str.replaceAll('.', ','); str = str.replaceAll('\n', ', '); - str = str.replace(/[^a-zA-Z0-9,:()']+/g, ' '); // Replace everything except alphanumeric characters and commas with spaces + str = str.replace(/[^a-zA-Z0-9,:()\-']+/g, ' '); // Replace everything except alphanumeric characters and commas with spaces str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one str = str.trim();