Files
facefusion-pinokio/install.js
T
2023-11-30 23:15:08 +01:00

77 lines
1.3 KiB
JavaScript

function install(kernel)
{
const { platform, arch, gpu } = kernel;
if (platform === 'darwin')
{
if (arch === 'arm64')
{
return 'python install.py --onnxruntime coreml-silicon --torch default';
}
return 'python install.py --onnxruntime default --torch default';
}
if ([ 'linux', 'win32' ].includes(platform) && gpu === 'nvidia')
{
return 'python install.py --onnxruntime cuda --torch cuda';
}
if (platform === 'linux' && gpu === 'amd')
{
return 'python install.py --onnxruntime directml --torch rocm';
}
return 'python install.py --onnxruntime default --torch cpu';
}
module.exports = async kernel =>
{
const config =
{
requires:
[
{
type: 'conda',
name:
[
'ffmpeg'
],
args: '-c conda-forge'
}
],
run:
[
{
method: 'shell.run',
params:
{
message: 'git clone https://github.com/facefusion/facefusion --branch 2.0.0 --single-branch'
}
},
{
method: 'shell.run',
params:
{
message: install(kernel),
path: 'facefusion',
venv: 'env'
}
},
{
method: 'input',
params:
{
title: 'Install complete',
description: 'Go back to the dashboard and launch the application.'
}
},
{
method: 'browser.open',
params:
{
uri: '/?selected=facefusion'
}
}
]
};
return config;
};