Khrisna commited on
Commit
68b288d
·
verified ·
1 Parent(s): b58aa14

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +3 -2
index.js CHANGED
@@ -504,8 +504,9 @@ async function upscaleImage(images) {
504
  colorEnhance: true, // enhance colors
505
  });
506
 
507
- const upscaledTensor = await tfjs.node.encodePng(tensor);
508
- const arrayBuffer = await upscaledTensor.arrayBuffer();
 
509
 
510
  // dispose the tensors!
511
  image.dispose();
 
504
  colorEnhance: true, // enhance colors
505
  });
506
 
507
+ const upscaledTensor = await tfjs.node.encodePng(tensor)
508
+ const typedArray = await upscaledTensor.data();
509
+ const arrayBuffer = Buffer.from(typedArray);
510
 
511
  // dispose the tensors!
512
  image.dispose();