forked from facefusion/facefusion-pinokio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.js
87 lines (84 loc) · 1.47 KB
/
install.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
function install(kernel)
{
const { platform, gpu } = kernel;
if (platform === 'darwin')
{
return 'python install.py --onnxruntime default';
}
if ([ 'linux', 'win32' ].includes(platform) && gpu === 'nvidia')
{
return 'python install.py --onnxruntime cuda-11.8';
}
if (gpu === 'amd')
{
if (platform === 'linux')
{
return 'python install.py --onnxruntime rocm-5.4.2';
}
if (platform === 'win32')
{
return 'python install.py --onnxruntime directml';
}
}
return 'python install.py --onnxruntime default';
}
module.exports = async kernel =>
{
const config =
{
run:
[
{
method: 'shell.run',
params:
{
message: 'git clone https://github.com/facefusion/facefusion --branch 2.5.3 --single-branch'
}
},
{
when: '{{ gpu === "nvidia" }}',
method: 'shell.run',
params:
{
message: 'conda install cudatoolkit=11.8 cudnn=8.9.2.26 conda-forge::gputil=1.4.0 --yes',
conda:
{
name: 'facefusion'
}
}
},
{
method: 'shell.run',
params:
{
message: install(kernel),
path: 'facefusion',
env:
{
PYTHONNOUSERSITE: 'True'
},
conda:
{
name: 'facefusion'
}
}
},
{
method: 'input',
params:
{
title: 'Install complete',
description: 'Go back to the dashboard to launch the application.'
}
},
{
method: 'browser.open',
params:
{
uri: '/?selected=facefusion'
}
}
]
};
return config;
};