1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-12 01:40:53 +01:00
upscayl/main/utils.js
2022-09-17 15:10:47 +05:30

26 lines
521 B
JavaScript

const { spawn } = require("child_process");
const { execPath } = require("./binaries");
/**
*
* @param {*} inputFile
* @param {*} outFile
* @param {*} modelsPath
* @param {*} model
* @returns
*/
function upscaylImage(inputFile, outFile, modelsPath, model) {
// UPSCALE
let upscayl = spawn(
execPath("realesrgan"),
["-i", inputFile, "-o", outFile, "-s", 4, "-m", modelsPath, "-n", model],
{
cwd: null,
detached: false,
}
);
return upscayl;
}
module.exports = { upscaylImage };