diff --git a/README.md b/README.md index 09cfedd..4b52ad4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ FaceFusion Pinokio ================== -> Next generation face swapper and enhancer. +> Industry leading face manipulation platform. [![Build Status](https://img.shields.io/github/actions/workflow/status/facefusion/facefusion-pinokio/ci.yml.svg?branch=master)](https://github.com/facefusion/facefusion-pinokio/actions?query=workflow:ci) [![Pinokio](https://img.shields.io/badge/open-pinokio-blue.svg)](https://pinokio.computer/item?uri=https://github.com/facefusion/facefusion-pinokio) diff --git a/facefusion.png b/facefusion.png new file mode 100755 index 0000000..24ce600 Binary files /dev/null and b/facefusion.png differ diff --git a/icon.png b/icon.png deleted file mode 100644 index 9ff7eb1..0000000 Binary files a/icon.png and /dev/null differ diff --git a/install.js b/install.js index 142093a..2a1c2c9 100644 --- a/install.js +++ b/install.js @@ -2,25 +2,25 @@ 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'; + return 'python install.py --onnxruntime rocm'; } if (platform === 'win32') { return 'python install.py --onnxruntime directml'; } } + if (gpu === 'intel') + { + return 'python install.py --onnxruntime openvino'; + } + if (gpu === 'nvidia') + { + return 'python install.py --onnxruntime cuda'; + } return 'python install.py --onnxruntime default'; } @@ -34,7 +34,19 @@ module.exports = async kernel => method: 'shell.run', params: { - message: 'git clone https://github.com/facefusion/facefusion --branch 2.6.1 --single-branch' + message: 'git clone https://github.com/facefusion/facefusion --branch 3.0.0 --single-branch' + } + }, + { + when: '{{ gpu === "intel" }}', + method: 'shell.run', + params: + { + message: 'conda install conda-forge::openvino=2024.3.0 --yes', + conda: + { + name: 'facefusion' + } } }, { @@ -42,7 +54,7 @@ module.exports = async kernel => method: 'shell.run', params: { - message: 'conda install cudatoolkit=11.8 cudnn=8.9.2.26 conda-forge::gputil=1.4.0 --yes', + message: 'conda install conda-forge::cuda-runtime=12.4.1 cudnn=9.2.1.18 --yes', conda: { name: 'facefusion' @@ -69,8 +81,8 @@ module.exports = async kernel => method: 'input', params: { - title: 'Install complete', - description: 'Go back to the dashboard to launch the application.' + title: 'Installation completed', + description: 'Return to the dashboard to start FaceFusion.' } }, { diff --git a/menu.js b/menu.js index 5b086a0..c5474b0 100644 --- a/menu.js +++ b/menu.js @@ -2,129 +2,9 @@ const path = require('path'); module.exports = async kernel => { - const hasInstall = await kernel.exists(__dirname, 'facefusion') && !await kernel.running(__dirname, 'install.js'); - - let menu = []; - - if (hasInstall) + if (!kernel.exists(__dirname, 'facefusion')) { - if (kernel.running(__dirname, 'start.js')) - { - const memory = kernel.memory.local[path.resolve(__dirname, 'start.js')]; - - if (memory && memory.url && memory.mode) - { - menu = - [ - { - icon: 'fa-solid fa-rocket', - text: 'Open session', - href: memory.url, - target: '_blank' - }, - { - icon: 'fa-solid fa-desktop', - text: 'Server (' + memory.mode + ')', - href: 'start.js', - params: - { - fullscreen: true - } - } - ]; - } - else - { - menu = - [ - { - icon: 'fa-solid fa-desktop', - text: 'Server', - href: 'start.js', - params: - { - fullscreen: true - } - } - ]; - } - } - else - { - menu = - [ - { - icon: 'fa-solid fa-power-off', - text: 'Launch default', - href: 'start.js', - params: - { - run: true, - fullscreen: true, - mode: 'Default' - } - }, - { - icon: 'fa-solid fa-gauge', - text: 'Launch benchmark', - href: 'start.js', - params: - { - run: true, - fullscreen: true, - mode: 'Benchmark' - } - }, - { - icon: 'fa-solid fa-camera', - text: 'Launch webcam', - href: 'start.js', - params: - { - run: true, - fullscreen: true, - mode: 'Webcam' - } - } - ]; - } - menu = menu.concat( - [ - { - icon: 'fa-solid fa-rotate', - text: 'Update', - href: 'update.js', - params: - { - run: true, - fullscreen: true - } - }, - { - icon: 'fa-solid fa-plug', - text: 'Install', - href: 'install.js', - params: - { - run: true, - fullscreen: true - } - }, - { - icon: 'fa-regular fa-circle-xmark', - text: 'Reset', - href: 'reset.js', - params: - { - run: true, - fullscreen: true - } - } - ]); - } - else - { - menu = + const menu = [ { icon: 'fa-solid fa-plug', @@ -137,6 +17,123 @@ module.exports = async kernel => } } ]; + + return menu; } + + [ + [ 'Installing', 'install.js' ], + [ 'Updating', 'update.js' ], + [ 'Resetting', 'reset.js' ] + ] + .forEach(([ text, href ]) => + { + if (kernel.running(__dirname, script)) + { + const menu = + [ + { + icon: 'fa-solid fa-spinner', + text, + href, + params: + { + run: true, + fullscreen: true + } + } + ]; + + return menu; + } + }); + + const menu = []; + + if (kernel.running(__dirname, 'start.js')) + { + const start_path = path.resolve(__dirname, 'start.js'); + const memory = kernel.memory.local[start_path]; + + if (memory && memory.url && memory.mode) + { + menu.concat( + [ + { + icon: 'fa-solid fa-rocket', + text: 'Open Session', + href: memory.url + }, + { + icon: 'fa-solid fa-desktop', + text: 'Server (' + memory.mode + ')', + href: 'start.js', + params: + { + fullscreen: true + } + } + ]); + } + else + { + menu.concat( + [ + { + icon: 'fa-solid fa-desktop', + text: 'Server', + href: 'start.js', + params: + { + fullscreen: true + } + } + ]); + } + } + + [ + [ 'fa-solid fa-plug', 'Install', 'install.js' ], + [ 'fa-solid fa-rotate', 'Update', 'update.js' ], + [ 'fa-regular fa-circle-xmark', 'Reset', 'reset.js' ] + ] + .forEach(([ icon, text, href ]) => + { + menu.concat( + [ + { + icon, + text, + href, + params: + { + run: true, + fullscreen: true + } + } + ]); + }); + + [ + [ 'fa-solid fa-power-off', 'Launch Default', 'Default' ], + [ 'fa-solid fa-gauge', 'Launch Benchmark', 'Benchmark' ], + [ 'fa-solid fa-robot', 'Launch Jobs', 'Jobs' ], + [ 'fa-solid fa-camera', 'Launch Webcam', 'Webcam' ] + ] + .forEach(([ icon, text, mode ]) => + { + menu.push({ + icon, + text, + href: 'start.js', + params: + { + run: true, + fullscreen: true, + mode + } + }); + }); + return menu; }; diff --git a/package.json b/package.json index e510bd7..f5234ad 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "facefusion-pinokio", - "description": "Next generation face swapper and enhancer", - "version": "2.6.1", + "description": "Industry leading face manipulation platform", + "version": "3.0.0", "license": "MIT", "devDependencies": { "@isnotdefined/eslint-config": "9.8.0", - "eslint": "8.56.0" + "eslint": "8.57.1" }, "scripts": { diff --git a/pinokio.js b/pinokio.js index ee296fe..b19e139 100644 --- a/pinokio.js +++ b/pinokio.js @@ -1,8 +1,8 @@ module.exports = { version: '1.5', - title: 'FaceFusion 2.6.1', - description: 'Next generation face swapper and enhancer', - icon: 'icon.png', + title: 'FaceFusion 3.0.0', + description: 'Industry leading face manipulation platform', + icon: 'facefusion.png', menu: require(__dirname + '/menu.js') }; diff --git a/start.js b/start.js index 986e5e2..1eb610a 100644 --- a/start.js +++ b/start.js @@ -5,9 +5,10 @@ module.exports = () => daemon: true, cmd: { - Default: 'python run.py', - Benchmark: 'python run.py --ui-layouts benchmark', - Webcam: 'python run.py --ui-layouts webcam' + Default: 'python facefusion.py run', + Benchmark: 'python facefusion.py run --ui-layouts benchmark', + Jobs: 'python facefusion.py run --ui-layouts jobs', + Webcam: 'python facefusion.py run --ui-layouts webcam' }, run: [ diff --git a/update.js b/update.js index ba8451d..49f80ea 100644 --- a/update.js +++ b/update.js @@ -23,7 +23,7 @@ module.exports = () => method: 'shell.run', params: { - message: 'git checkout 2.6.1', + message: 'git checkout 3.0.0', path: 'facefusion' } }