Return character prefixes to brush image generation (#4833) * Return character prompt prefixes to brush image generation Before [#4719](https://github.com/SillyTavern/SillyTavern/pull/4719), the brush tool would generate an image using the character specific prompt prefixes. This returns that functionality. * eslint fix --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

765c76ea80480f1b8a95d24aacc9fc28bea4e104

drake1138 <drakeroz1138@gmail.com>

1 files changed, +8 -2Showing whitespace changes
public/scripts/extensions/stable-diffusion/index.js+8 -2
@@ -2907,10 +2907,16 @@ async function generatePrompt(quietPrompt) {
2907 */2907 */
2908async function sendGenerationRequest(generationType, prompt, additionalNegativePrefix, characterName, callback, initiator, signal) {2908async function sendGenerationRequest(generationType, prompt, additionalNegativePrefix, characterName, callback, initiator, signal) {
2909 const noCharPrefix = [generationMode.FREE, generationMode.BACKGROUND, generationMode.USER, generationMode.USER_MULTIMODAL, generationMode.FREE_EXTENDED];2909 const noCharPrefix = [generationMode.FREE, generationMode.BACKGROUND, generationMode.USER, generationMode.USER_MULTIMODAL, generationMode.FREE_EXTENDED];
2910 const prefix = noCharPrefix.includes(generationType)2910 const isCharChat = this_chid !== undefined && !selected_group;
2911 const ignoreNoCharForSwipe = initiator === initiators.swipe && isCharChat;
2912
2913 const skipCharPrefix = !ignoreNoCharForSwipe && noCharPrefix.includes(generationType);
2914
2915 const prefix = skipCharPrefix
2911 ? extension_settings.sd.prompt_prefix2916 ? extension_settings.sd.prompt_prefix
2912 : combinePrefixes(extension_settings.sd.prompt_prefix, getCharacterPrefix());2917 : combinePrefixes(extension_settings.sd.prompt_prefix, getCharacterPrefix());
2913 const negativePrefix = noCharPrefix.includes(generationType)2918
2919 const negativePrefix = skipCharPrefix
2914 ? extension_settings.sd.negative_prompt2920 ? extension_settings.sd.negative_prompt
2915 : combinePrefixes(extension_settings.sd.negative_prompt, getCharacterNegativePrefix());2921 : combinePrefixes(extension_settings.sd.negative_prompt, getCharacterNegativePrefix());
29162922