mirror of
https://github.com/upscayl/upscayl.git
synced 2024-12-18 18:35:58 +01:00
24 lines
447 B
TypeScript
24 lines
447 B
TypeScript
|
import { spawn } from "child_process";
|
||
|
import { execPath } from "./binaries";
|
||
|
|
||
|
function upscaylImage(
|
||
|
inputFile: string,
|
||
|
outFile: string,
|
||
|
modelsPath: string,
|
||
|
model: string
|
||
|
) {
|
||
|
// UPSCALE
|
||
|
let upscayl = spawn(
|
||
|
execPath("realesrgan"),
|
||
|
["-i", inputFile, "-o", outFile, "-s", "4", "-m", modelsPath, "-n", model],
|
||
|
{
|
||
|
cwd: undefined,
|
||
|
detached: false,
|
||
|
}
|
||
|
);
|
||
|
|
||
|
return upscayl;
|
||
|
}
|
||
|
|
||
|
module.exports = { upscaylImage };
|