Allow macros in positive and negative prompts

This commit is contained in:
Cohee 2024-04-29 13:50:55 +03:00
parent e4de6da5b8
commit e0df5783f8

View File

@ -2189,11 +2189,11 @@ async function sendGenerationRequest(generationType, prompt, characterName = nul
? extension_settings.sd.prompt_prefix ? extension_settings.sd.prompt_prefix
: combinePrefixes(extension_settings.sd.prompt_prefix, getCharacterPrefix()); : combinePrefixes(extension_settings.sd.prompt_prefix, getCharacterPrefix());
const prefixedPrompt = combinePrefixes(prefix, prompt, '{prompt}'); const prefixedPrompt = substituteParams(combinePrefixes(prefix, prompt, '{prompt}'));
const negativePrompt = noCharPrefix.includes(generationType) const negativePrompt = substituteParams(noCharPrefix.includes(generationType)
? extension_settings.sd.negative_prompt ? extension_settings.sd.negative_prompt
: combinePrefixes(extension_settings.sd.negative_prompt, getCharacterNegativePrefix()); : combinePrefixes(extension_settings.sd.negative_prompt, getCharacterNegativePrefix()));
let result = { format: '', data: '' }; let result = { format: '', data: '' };
const currentChatId = getCurrentChatId(); const currentChatId = getCurrentChatId();