Responding to PR change reviews

3a2d29b5cbab98e936c727ef37d347783992b2ee

Daryl <daryl.streete@snhu.edu>

1 files changed, +3 -11Showing whitespace changes
public/scripts/extensions/stable-diffusion/index.js+3 -11
@@ -2334,19 +2334,12 @@ function processReply(str) {
23342334 }
23352335
23362336 str = str.replaceAll('"', '');
23372337 str = str.replaceAll('"', '');
23382338 str = str.replaceAll('\n', ', ');
23392339 str = str.normalize('NFD');
23402340
2341- // Check if using NAI Diffusion V4 models and preserve pipe (|) and hash (#) characters
2341+ // Strip out non-alphanumeric characters barring model syntax exceptions
2342- if (extension_settings.sd.model === 'nai-diffusion-4-full' ||
2343- extension_settings.sd.model === 'nai-diffusion-4-curated-preview') {
2344- // Keep pipe and hash characters for NAI Diffusion V4 models
23452342 str = str.replace(/[^a-zA-Z0-9.,:_(){}<>[\]\-'|#]+/g, ' ');
2346- } else {
2347- // Original behavior for other models
2348- str = str.replace(/[^a-zA-Z0-9.,:_(){}<>[\]\-']+/g, ' ');
2349- }
23502343
23512344 str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one
23522345 str = str.trim();
@@ -3242,8 +3235,7 @@ function getNovelParams() {
32423235 }
32433236
32443237 if (extension_settings.sd.sampler === 'ddim' ||
3245- extension_settings.sd.model === 'nai-diffusion-4-curated-preview' ||
3238+ ['nai-diffusion-4-curated-preview', 'nai-diffusion-4-full'].includes(extension_settings.sd.model)) {
3246- extension_settings.sd.model === 'nai-diffusion-4-full') {
32473239 sm = false;
32483240 sm_dyn = false;
32493241 }