Error handling for Comfy request

This commit is contained in:
Cohee 2024-04-19 00:39:04 +03:00
parent 901ffa3cdc
commit eab545cafc
1 changed files with 4 additions and 0 deletions

View File

@ -2673,6 +2673,10 @@ async function generateComfyImage(prompt, negativePrompt) {
}`,
}),
});
if (!promptResult.ok) {
const text = await promptResult.text();
throw new Error(text);
}
return { format: 'png', data: await promptResult.text() };
}