Khrisna commited on
Commit
2ba9156
·
verified ·
1 Parent(s): a30c07d

Update lib/enchance.js

Browse files
Files changed (1) hide show
  1. lib/enchance.js +2 -2
lib/enchance.js CHANGED
@@ -52,7 +52,7 @@ async function upscaler(images) {
52
 
53
  }
54
 
55
- async function processImageUpscaler({ urlPath, method, filenames, mimetype }) {
56
  return new Promise(async (resolve, reject) => {
57
  let Methods = ["enhance"];
58
  Methods.includes(method)? (method = method) : (method = Methods[0]);
@@ -63,7 +63,7 @@ async function processImageUpscaler({ urlPath, method, filenames, mimetype }) {
63
 
64
  formData.append("model_version", 1);
65
 
66
- formData.append("image", await fs.promises.readFile(urlPath), {
67
  filename: filenames,
68
  contentType: mimetype,
69
  });
 
52
 
53
  }
54
 
55
+ async function processImageUpscaler({ buffer, method, filenames, mimetype }) {
56
  return new Promise(async (resolve, reject) => {
57
  let Methods = ["enhance"];
58
  Methods.includes(method)? (method = method) : (method = Methods[0]);
 
63
 
64
  formData.append("model_version", 1);
65
 
66
+ formData.append("image", buffer, {
67
  filename: filenames,
68
  contentType: mimetype,
69
  });