mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 17:36:22 +01:00
Make generation actually work
This commit is contained in:
parent
e32b0cc223
commit
5da3921907
@ -2725,12 +2725,10 @@ async function generateStabilityImage(prompt, negativePrompt) {
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
||||
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
||||
}
|
||||
|
||||
const blob = await response.blob();
|
||||
const base64Image = await getBase64Async(blob);
|
||||
const base64Image = await response.text();
|
||||
|
||||
return {
|
||||
format: IMAGE_FORMAT,
|
||||
|
@ -836,6 +836,7 @@ stability.post('/generate', jsonParser, async (request, response) => {
|
||||
'Accept': 'image/*',
|
||||
},
|
||||
body: formData,
|
||||
timeout: 0,
|
||||
});
|
||||
|
||||
if (!result.ok) {
|
||||
@ -845,7 +846,7 @@ stability.post('/generate', jsonParser, async (request, response) => {
|
||||
}
|
||||
|
||||
const buffer = await result.buffer();
|
||||
return response.send(buffer);
|
||||
return response.send(buffer.toString('base64'));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return response.sendStatus(500);
|
||||
|
Loading…
Reference in New Issue
Block a user