mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add multimodal captioning for SD prompt generation
This commit is contained in:
@ -1867,10 +1867,35 @@ function addOneMessage(mes, { type = "normal", insertAfter = null, scroll = true
|
||||
}
|
||||
}
|
||||
|
||||
function getUserAvatar(avatarImg) {
|
||||
/**
|
||||
* Returns the URL of the avatar for the given user avatar Id.
|
||||
* @param {string} avatarImg User avatar Id
|
||||
* @returns {string} User avatar URL
|
||||
*/
|
||||
export function getUserAvatar(avatarImg) {
|
||||
return `User Avatars/${avatarImg}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL of the avatar for the given character Id.
|
||||
* @param {number} characterId Character Id
|
||||
* @returns {string} Avatar URL
|
||||
*/
|
||||
export function getCharacterAvatar(characterId) {
|
||||
const character = characters[characterId];
|
||||
const avatarImg = character?.avatar;
|
||||
|
||||
if (!avatarImg || avatarImg === 'none') {
|
||||
return default_avatar;
|
||||
}
|
||||
|
||||
return formatCharacterAvatar(avatarImg);
|
||||
}
|
||||
|
||||
export function formatCharacterAvatar(characterAvatar) {
|
||||
return `characters/${characterAvatar}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the title for the generation timer.
|
||||
* @param {Date} gen_started Date when generation was started
|
||||
|
Reference in New Issue
Block a user