Khrisna commited on
Commit
4166bc4
·
verified ·
1 Parent(s): 894af86

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -147,7 +147,7 @@ app.post('/api/toanime', async (req, res) => {
147
  res.json({ error: true, message: e === '[object Object]' ? 'Internal Server Error' : e })
148
  }
149
  })
150
- app.post('/api/upcaler', async (req, res) => {
151
  try {
152
  console.log(req.body)
153
  const { images, denoise, scale, format, type, status } = req.body
@@ -404,7 +404,7 @@ async function processImage(image, denoise, scale, format, type) {
404
  formData.append("scale", scale);
405
  formData.append("format", format);
406
  formData.append("type", type);
407
- formData.append("file", fs.readFileSync(image), {
408
  filename:
409
  "images_" + random_numbers.toString().padStart(3, "0") + ".jpeg",
410
  contentType: "image/jpeg",
 
147
  res.json({ error: true, message: e === '[object Object]' ? 'Internal Server Error' : e })
148
  }
149
  })
150
+ app.post('/api/upscaler', async (req, res) => {
151
  try {
152
  console.log(req.body)
153
  const { images, denoise, scale, format, type, status } = req.body
 
404
  formData.append("scale", scale);
405
  formData.append("format", format);
406
  formData.append("type", type);
407
+ formData.append("file", image, {
408
  filename:
409
  "images_" + random_numbers.toString().padStart(3, "0") + ".jpeg",
410
  contentType: "image/jpeg",