mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-12 01:40:53 +01:00
26 lines
521 B
JavaScript
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 };
|