mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'dev' of https://github.com/Cohee1207/SillyTavern into dev
This commit is contained in:
@ -2096,11 +2096,6 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
}
|
||||
}
|
||||
|
||||
// Add quiet generation prompt at depth 0
|
||||
if (quiet_prompt && quiet_prompt.length) {
|
||||
finalPromt += `\n${quiet_prompt}`;
|
||||
}
|
||||
|
||||
finalPromt = finalPromt.replace(/\r/gm, '');
|
||||
|
||||
if (power_user.collapse_newlines) {
|
||||
|
@ -229,6 +229,10 @@ async function loadHordeSamplers() {
|
||||
}
|
||||
|
||||
async function loadExtrasSamplers() {
|
||||
if (!modules.includes('sd')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const url = new URL(getApiUrl());
|
||||
url.pathname = '/api/image/samplers';
|
||||
const result = await fetch(url, defaultRequestArgs);
|
||||
@ -276,6 +280,10 @@ async function loadHordeModels() {
|
||||
}
|
||||
|
||||
async function loadExtrasModels() {
|
||||
if (!modules.includes('sd')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const url = new URL(getApiUrl());
|
||||
url.pathname = '/api/image/model';
|
||||
const getCurrentModelResult = await fetch(url, defaultRequestArgs);
|
||||
@ -401,11 +409,12 @@ async function generateExtrasImage(prompt) {
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
if (result.ok) {
|
||||
const data = await result.json();
|
||||
const base64Image = `data:image/jpeg;base64,${data.image}`;
|
||||
sendMessage(prompt, base64Image);
|
||||
} else {
|
||||
callPopup('Image generation has failed. Please try again.', 'text');
|
||||
}
|
||||
}
|
||||
|
||||
@ -431,6 +440,8 @@ async function generateHordeImage(prompt) {
|
||||
const data = await result.text();
|
||||
const base64Image = `data:image/webp;base64,${data}`;
|
||||
sendMessage(prompt, base64Image);
|
||||
} else {
|
||||
callPopup('Image generation has failed. Please try again.', 'text');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user