mirror of
https://github.com/facefusion/facefusion-pinokio.git
synced 2026-08-21 18:57:13 +02:00
Initial commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_size = 4
|
||||
indent_style = tab
|
||||
trim_trailing_whitespace = true
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends":
|
||||
[
|
||||
"@isnotdefined/eslint-config/common"
|
||||
],
|
||||
"parserOptions":
|
||||
{
|
||||
"ecmaVersion": 2020
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
github: henryruhs
|
||||
custom: https://paypal.me/henryruhs
|
||||
@@ -0,0 +1,16 @@
|
||||
name: ci
|
||||
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Node 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- run: npm install
|
||||
- run: npm run lint
|
||||
@@ -0,0 +1,3 @@
|
||||
.idea
|
||||
.vscode
|
||||
node_modules
|
||||
@@ -0,0 +1,6 @@
|
||||
FaceFusion Pinokio
|
||||
==================
|
||||
|
||||
> Next generation face swapper and enhancer.
|
||||
|
||||
[](https://github.com/facefusion/facefusion-pinokio/actions?query=workflow:ci)
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
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 (gpu === 'nvidia')
|
||||
{
|
||||
return 'python install.py --onnxruntime cuda --torch cuda';
|
||||
}
|
||||
if (gpu === 'amd')
|
||||
{
|
||||
return 'python install.py --onnxruntime default --torch cpu';
|
||||
}
|
||||
return 'python install.py --onnxruntime default --torch cpu';
|
||||
}
|
||||
|
||||
module.exports = async kernel =>
|
||||
{
|
||||
const config =
|
||||
{
|
||||
requires:
|
||||
[
|
||||
{
|
||||
type: 'conda',
|
||||
name:
|
||||
[
|
||||
'cmake',
|
||||
'ffmpeg'
|
||||
],
|
||||
args: '-c conda-forge'
|
||||
},
|
||||
{
|
||||
gpu: 'nvidia',
|
||||
name: 'cuda'
|
||||
}
|
||||
],
|
||||
run:
|
||||
[
|
||||
{
|
||||
method: 'shell.run',
|
||||
params:
|
||||
{
|
||||
message: 'git clone https://github.com/facefusion/facefusion --branch next --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;
|
||||
};
|
||||
@@ -0,0 +1,106 @@
|
||||
module.exports = async kernel =>
|
||||
{
|
||||
const hasEnv = await kernel.exists(__dirname, 'facefusion', 'env');
|
||||
const hasRepo = await kernel.exists(__dirname, 'facefusion');
|
||||
|
||||
let menu = [];
|
||||
|
||||
if (hasEnv && hasRepo)
|
||||
{
|
||||
if (kernel.running(__dirname, 'start.js'))
|
||||
{
|
||||
const session = await kernel.require(__dirname, 'session.json');
|
||||
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-spin fa-circle-notch',
|
||||
text: 'Running ' + session.mode
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-desktop',
|
||||
text: 'Server',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
];
|
||||
if (session && session.url)
|
||||
{
|
||||
menu.push(
|
||||
{
|
||||
icon: 'fa-solid fa-rocket',
|
||||
text: 'Open session',
|
||||
href: session.url,
|
||||
target: '_blank'
|
||||
});
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-photo-film',
|
||||
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-webcam',
|
||||
text: 'Launch webcam',
|
||||
href: 'start.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true,
|
||||
mode: 'Webcam'
|
||||
}
|
||||
},
|
||||
{
|
||||
icon: 'fa-solid fa-rotate',
|
||||
text: 'Update',
|
||||
href: 'update.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
menu =
|
||||
[
|
||||
{
|
||||
icon: 'fa-solid fa-plug',
|
||||
text: 'Install',
|
||||
href: 'install.js',
|
||||
params:
|
||||
{
|
||||
run: true,
|
||||
fullscreen: true
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
return menu;
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "facefusion-pinokio",
|
||||
"description": "Next generation face swapper and enhancer",
|
||||
"version": "2.0.0",
|
||||
"license": "MIT",
|
||||
"devDependencies":
|
||||
{
|
||||
"@isnotdefined/eslint-config": "9.8.0",
|
||||
"eslint": "8.54.0"
|
||||
},
|
||||
"scripts":
|
||||
{
|
||||
"lint": "eslint . --ext=.js",
|
||||
"fix": "npm run lint -- --fix"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
module.exports =
|
||||
{
|
||||
title: 'FaceFusion Next',
|
||||
description: 'Next generation face swapper and enhancer',
|
||||
icon: 'icon.png',
|
||||
menu: require(__dirname + '/menu.js')
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
module.exports = () =>
|
||||
{
|
||||
const config =
|
||||
{
|
||||
daemon: true,
|
||||
cmd:
|
||||
{
|
||||
Default: 'python run.py',
|
||||
Benchmark: 'python run.py --ui-layouts benchmark',
|
||||
Webcam: 'python run.py --ui-layouts webcam'
|
||||
},
|
||||
run:
|
||||
[
|
||||
{
|
||||
method: 'local.set',
|
||||
params:
|
||||
{
|
||||
mode: '{{input.mode}}'
|
||||
}
|
||||
},
|
||||
{
|
||||
method: 'shell.run',
|
||||
params:
|
||||
{
|
||||
message: '{{self.cmd[local.mode]}}',
|
||||
path: 'facefusion',
|
||||
venv: 'env',
|
||||
on:
|
||||
[
|
||||
{
|
||||
event: '/(http:\/\/[0-9.:]+)/',
|
||||
done: true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
method: 'self.set',
|
||||
params:
|
||||
{
|
||||
'session.json':
|
||||
{
|
||||
mode: '{{local.mode}}',
|
||||
url: '{{input.stdout.match(/(http:\\S+)/gi)[0]}}'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
method: 'browser.open',
|
||||
params:
|
||||
{
|
||||
uri: '{{self.session.url}}',
|
||||
target: '_blank'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
return config;
|
||||
};
|
||||
Reference in New Issue
Block a user