Updated the processReply method to NOT remove pipe | or hash # characters when the selected model is nai-diffusion-v4 curated or full.

8271bf36c73d236f554bd69ae51c3bc6492bd896

Daryl <daryl.streete@snhu.edu>

1 files changed, +12 -2Ignore whitespace
public/scripts/extensions/stable-diffusion/index.js+12 -2
@@ -2334,10 +2334,20 @@ function processReply(str) {
2334 }2334 }
23352335
2336 str = str.replaceAll('"', '');2336 str = str.replaceAll('"', '');
2337 str = str.replaceAll('“', '');2337 str = str.replaceAll('"', '');
2338 str = str.replaceAll('\n', ', ');2338 str = str.replaceAll('\n', ', ');
2339 str = str.normalize('NFD');2339 str = str.normalize('NFD');
2340 str = str.replace(/[^a-zA-Z0-9.,:_(){}<>[\]\-']+/g, ' ');2340
2341 // Check if using NAI Diffusion V4 models and preserve pipe (|) and hash (#) characters
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
2345 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 }
2350
2341 str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one2351 str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one
2342 str = str.trim();2352 str = str.trim();
23432353