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) {
23342334 }
23352335
23362336 str = str.replaceAll('"', '');
23372337 str = str.replaceAll('"', '');
23382338 str = str.replaceAll('\n', ', ');
23392339 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+
23412351 str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one
23422352 str = str.trim();
23432353