Make generation actually work
| @@ -2725,12 +2725,10 @@ async function generateStabilityImage(prompt, negativePrompt) { | ||
| 2725 | 2725 | }); |
| 2726 | 2726 | |
| 2727 | 2727 | if (!response.ok) { |
| 2728 | - const errorText = await response.text(); | |
| 2728 | + throw new Error(`HTTP ${response.status}: ${response.statusText}`); | |
| 2729 | - throw new Error(`HTTP ${response.status}: ${errorText}`); | |
| 2730 | 2729 | } |
| 2731 | 2730 | |
| 2732 | 2731 | const blobbase64Image = await response.blobtext(); |
| 2733 | - const base64Image = await getBase64Async(blob); | |
| 2734 | 2732 | |
| 2735 | 2733 | return { |
| 2736 | 2734 | format: IMAGE_FORMAT, |
| @@ -836,6 +836,7 @@ stability.post('/generate', jsonParser, async (request, response) => { | ||
| 836 | 836 | 'Accept': 'image/*', |
| 837 | 837 | }, |
| 838 | 838 | body: formData, |
| 839 | + timeout: 0, | |
| 839 | 840 | }); |
| 840 | 841 | |
| 841 | 842 | if (!result.ok) { |
| @@ -845,7 +846,7 @@ stability.post('/generate', jsonParser, async (request, response) => { | ||
| 845 | 846 | } |
| 846 | 847 | |
| 847 | 848 | const buffer = await result.buffer(); |
| 848 | 849 | return response.send(buffer.toString('base64')); |
| 849 | 850 | } catch (error) { |
| 850 | 851 | console.log(error); |
| 851 | 852 | return response.sendStatus(500); |