From e0ac189acc2ee836d431ff83e6ed4264bef2e236 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Tue, 21 May 2024 16:51:11 +0300 Subject: [PATCH] #2290 Allow square brackets and underline 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 beb4879b2..6638a3d10 100644 --- a/public/scripts/extensions/stable-diffusion/index.js +++ b/public/scripts/extensions/stable-diffusion/index.js @@ -1885,7 +1885,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, ' '); str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one str = str.trim();