Return from Generate if calling circuit breaker

This commit is contained in:
Cohee 2023-12-11 19:07:33 +02:00
parent e96fb0c1b5
commit 0302686a96
2 changed files with 4 additions and 2 deletions

View File

@ -3880,6 +3880,7 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
const result = await await Generate(type, { automatic_trigger, force_name2: true, quiet_prompt, skipWIAN, force_chid, maxLoops: maxLoops - 1 });
resolve(result);
});
return;
}
if (power_user.auto_swipe) {

View File

@ -1781,13 +1781,14 @@ async function generateMultimodalPrompt(generationType, quietPrompt) {
*/
async function generatePrompt(quietPrompt) {
const reply = await generateQuietPrompt(quietPrompt, false, false);
const processedReply = processReply(reply);
if (!reply) {
if (!processedReply) {
toastr.error('Prompt generation produced no text. Make sure you\'re using a valid instruct template and try again', 'Image Generation');
throw new Error('Prompt generation failed.');
}
return processReply(reply);
return processedReply;
}
async function sendGenerationRequest(generationType, prompt, characterName = null, callback) {