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

This commit is contained in:
Daryl 2025-03-01 02:06:26 -04:00
parent d788c2fbb5
commit 8271bf36c7

View File

@ -2334,10 +2334,20 @@ function processReply(str) {
}
str = str.replaceAll('"', '');
str = str.replaceAll('', '');
str = str.replaceAll('"', '');
str = str.replaceAll('\n', ', ');
str = str.normalize('NFD');
// Check if using NAI Diffusion V4 models and preserve pipe (|) and hash (#) characters
if (extension_settings.sd.model === 'nai-diffusion-4-full' ||
extension_settings.sd.model === 'nai-diffusion-4-curated-preview') {
// Keep pipe and hash characters for NAI Diffusion V4 models
str = str.replace(/[^a-zA-Z0-9.,:_(){}<>[\]\-'|#]+/g, ' ');
} else {
// Original behavior for other models
str = str.replace(/[^a-zA-Z0-9.,:_(){}<>[\]\-']+/g, ' ');
}
str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one
str = str.trim();