Merge branch 'staging' into neo-server

This commit is contained in:
Cohee 2024-04-21 21:56:36 +03:00
commit 5fd6202e60
2 changed files with 7 additions and 3 deletions

View File

@ -37,6 +37,8 @@ const p = a => `<p>${a}</p>`;
const MODULE_NAME = 'sd'; const MODULE_NAME = 'sd';
const UPDATE_INTERVAL = 1000; const UPDATE_INTERVAL = 1000;
// This is a 1x1 transparent PNG
const PNG_PIXEL = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
const sources = { const sources = {
extras: 'extras', extras: 'extras',
@ -2650,6 +2652,8 @@ async function generateComfyImage(prompt, negativePrompt) {
const avatarBlob = await response.blob(); const avatarBlob = await response.blob();
const avatarBase64 = await getBase64Async(avatarBlob); const avatarBase64 = await getBase64Async(avatarBlob);
workflow = workflow.replace('"%user_avatar%"', JSON.stringify(avatarBase64)); workflow = workflow.replace('"%user_avatar%"', JSON.stringify(avatarBase64));
} else {
workflow = workflow.replace('"%user_avatar%"', JSON.stringify(PNG_PIXEL));
} }
} }
if (/%char_avatar%/gi.test(workflow)) { if (/%char_avatar%/gi.test(workflow)) {
@ -2658,6 +2662,8 @@ async function generateComfyImage(prompt, negativePrompt) {
const avatarBlob = await response.blob(); const avatarBlob = await response.blob();
const avatarBase64 = await getBase64Async(avatarBlob); const avatarBase64 = await getBase64Async(avatarBlob);
workflow = workflow.replace('"%char_avatar%"', JSON.stringify(avatarBase64)); workflow = workflow.replace('"%char_avatar%"', JSON.stringify(avatarBase64));
} else {
workflow = workflow.replace('"%char_avatar%"', JSON.stringify(PNG_PIXEL));
} }
} }
console.log(`{ console.log(`{

View File

@ -188,9 +188,7 @@ export async function getGroupChat(groupId, reload = false) {
if (Array.isArray(data) && data.length) { if (Array.isArray(data) && data.length) {
data[0].is_group = true; data[0].is_group = true;
for (let key of data) { chat.splice(0, chat.length, ...data);
chat.push(key);
}
await printMessages(); await printMessages();
} else { } else {
sendSystemMessage(system_message_types.GROUP, '', { isSmallSys: true }); sendSystemMessage(system_message_types.GROUP, '', { isSmallSys: true });