mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-05-31 19:19:17 +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('"', '');
|
||||||
str = str.replaceAll('\n', ', ');
|
str = str.replaceAll('\n', ', ');
|
||||||
str = str.normalize('NFD');
|
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(/[^a-zA-Z0-9.,:_(){}<>[\]\-']+/g, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one
|
str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one
|
||||||
str = str.trim();
|
str = str.trim();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user