mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-05-28 09:44:29 +02:00
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:
parent
d788c2fbb5
commit
8271bf36c7
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user