Don't use deprecated fetch method.

This commit is contained in:
Cohee 2024-11-18 20:39:44 +02:00
parent b2b5c1f10c
commit 5478b37b22
1 changed files with 2 additions and 2 deletions

View File

@ -575,8 +575,8 @@ comfy.post('/generate', jsonParser, async (request, response) => {
if (!imgResponse.ok) {
throw new Error('ComfyUI returned an error.');
}
const imgBuffer = await imgResponse.buffer();
return response.send(imgBuffer.toString('base64'));
const imgBuffer = await imgResponse.arrayBuffer();
return response.send(Buffer.from(imgBuffer).toString('base64'));
} catch (error) {
console.log('ComfyUI error:', error);
response.status(500).send(error.message);