DeFactOfficial commited on
Commit
dde71af
1 Parent(s): ffbb6f0

Update image.js

Browse files
Files changed (1) hide show
  1. image.js +3 -3
image.js CHANGED
@@ -115,9 +115,9 @@ const generateImage = async(requestPayload, res, responseFormat) => {
115
  res.json({"image_url": "https://defactofficial-mmapi-2.hf.space/image_out/"+ cachePath.split("/").at(-1)})
116
  res.end()
117
  } else {
118
- res.setHeader('Content-Type', 'application/octet-stream');
119
- res.sendFile(cachePath);
120
- res.end()
121
  }
122
  } catch (error) {
123
  res.status(500).send(`Error: Failed to generate image - ${error.message}`);
 
115
  res.json({"image_url": "https://defactofficial-mmapi-2.hf.space/image_out/"+ cachePath.split("/").at(-1)})
116
  res.end()
117
  } else {
118
+ res.setHeader('Content-Type', 'image/png');
119
+ await res.sendFile(cachePath);
120
+ //res.end()
121
  }
122
  } catch (error) {
123
  res.status(500).send(`Error: Failed to generate image - ${error.message}`);