Upload 11 files
Browse files- .gitattributes +4 -0
- NeuroDonu/PortableSource(for portables)/7z.exe +3 -0
- NeuroDonu/PortableSource(for portables)/CUDA.7z +3 -0
- NeuroDonu/PortableSource(for portables)/CUDA_124.7z +3 -0
- NeuroDonu/PortableSource(for portables)/aria2c.exe +3 -0
- NeuroDonu/PortableSource(for portables)/ffmpeg.7z +3 -0
- NeuroDonu/PortableSource(for portables)/git.7z +3 -0
- NeuroDonu/PortableSource(for portables)/onnxruntime_providers_cuda.dll +3 -0
- NeuroDonu/PortableSource(for portables)/onnxruntime_providers_shared.dll +0 -0
- NeuroDonu/PortableSource(for portables)/onnxruntime_providers_tensorrt.dll +3 -0
- NeuroDonu/PortableSource(for portables)/python.7z +3 -0
- NeuroDonu/PortableSource(for portables)/updater_facefusion.py +135 -0
.gitattributes
CHANGED
|
@@ -190,3 +190,7 @@ Repacks[[:space:]]\[NNMClub.to\]/FL[[:space:]]Studio[[:space:]]Producer[[:space:
|
|
| 190 |
Repacks[[:space:]]\[NNMClub.to\]/Microsoft[[:space:]]Office[[:space:]]2007[[:space:]]SP3[[:space:]]Standard[[:space:]]12.0.6798.5000[[:space:]]Portable[[:space:]]by[[:space:]]XpucT.exe filter=lfs diff=lfs merge=lfs -text
|
| 191 |
Repacks[[:space:]]\[NNMClub.to\]/Mozilla[[:space:]]FireFox[[:space:]]103.0.0.8234[[:space:]]Portable[[:space:]]by[[:space:]]JolyAnderson.exe filter=lfs diff=lfs merge=lfs -text
|
| 192 |
Repacks[[:space:]]\[NNMClub.to\]/Spotify[[:space:]]1.1.90.859[[:space:]]Portable[[:space:]]by[[:space:]]JolyAnderson.exe filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
Repacks[[:space:]]\[NNMClub.to\]/Microsoft[[:space:]]Office[[:space:]]2007[[:space:]]SP3[[:space:]]Standard[[:space:]]12.0.6798.5000[[:space:]]Portable[[:space:]]by[[:space:]]XpucT.exe filter=lfs diff=lfs merge=lfs -text
|
| 191 |
Repacks[[:space:]]\[NNMClub.to\]/Mozilla[[:space:]]FireFox[[:space:]]103.0.0.8234[[:space:]]Portable[[:space:]]by[[:space:]]JolyAnderson.exe filter=lfs diff=lfs merge=lfs -text
|
| 192 |
Repacks[[:space:]]\[NNMClub.to\]/Spotify[[:space:]]1.1.90.859[[:space:]]Portable[[:space:]]by[[:space:]]JolyAnderson.exe filter=lfs diff=lfs merge=lfs -text
|
| 193 |
+
NeuroDonu/PortableSource(for[[:space:]]portables)/7z.exe filter=lfs diff=lfs merge=lfs -text
|
| 194 |
+
NeuroDonu/PortableSource(for[[:space:]]portables)/aria2c.exe filter=lfs diff=lfs merge=lfs -text
|
| 195 |
+
NeuroDonu/PortableSource(for[[:space:]]portables)/onnxruntime_providers_cuda.dll filter=lfs diff=lfs merge=lfs -text
|
| 196 |
+
NeuroDonu/PortableSource(for[[:space:]]portables)/onnxruntime_providers_tensorrt.dll filter=lfs diff=lfs merge=lfs -text
|
NeuroDonu/PortableSource(for portables)/7z.exe
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b16c41ae39b679384b06f1492b587b650716430ff9c2e079dca2ad1f62c952d
|
| 3 |
+
size 591360
|
NeuroDonu/PortableSource(for portables)/CUDA.7z
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:09780b488e354ea064c81b1215f2f4326d783b4bff9e8479593a1885f4e0e966
|
| 3 |
+
size 1887698050
|
NeuroDonu/PortableSource(for portables)/CUDA_124.7z
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a5ad9811ae0f7e0b4c8990dff41a1f573e570ee8c7a5109ed70bb9d4742d77e9
|
| 3 |
+
size 2227765734
|
NeuroDonu/PortableSource(for portables)/aria2c.exe
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be2099c214f63a3cb4954b09a0becd6e2e34660b886d4c898d260febfe9d70c2
|
| 3 |
+
size 5649408
|
NeuroDonu/PortableSource(for portables)/ffmpeg.7z
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:963a79ee123c3728b7af94ee18f381d12fc3cd22b0450b85114d3e8aa10e40a5
|
| 3 |
+
size 91123765
|
NeuroDonu/PortableSource(for portables)/git.7z
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:744feb04dc89b3f5df05090649d475fcbe39af3e47c5fda2f30706fa29cbc857
|
| 3 |
+
size 62090962
|
NeuroDonu/PortableSource(for portables)/onnxruntime_providers_cuda.dll
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac5c4000c62489fad6809c02c7fa2d8f4432cea9a63809e23f8ecddbdd24180c
|
| 3 |
+
size 474678768
|
NeuroDonu/PortableSource(for portables)/onnxruntime_providers_shared.dll
ADDED
|
Binary file (21 kB). View file
|
|
|
NeuroDonu/PortableSource(for portables)/onnxruntime_providers_tensorrt.dll
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d64b3e7d666c80677102d87102368c943a29caf9bbc7c4b07bdd735135ae93d5
|
| 3 |
+
size 750048
|
NeuroDonu/PortableSource(for portables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
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import subprocess
|
| 3 |
+
import sys
|
| 4 |
+
import locale
|
| 5 |
+
import winreg
|
| 6 |
+
|
| 7 |
+
def get_available_drives():
|
| 8 |
+
drives = []
|
| 9 |
+
for drive in range(65, 91): # ASCII коды от A (65) до Z (90)
|
| 10 |
+
drive_letter = f"{chr(drive)}:\\"
|
| 11 |
+
if os.path.exists(drive_letter):
|
| 12 |
+
drives.append(drive_letter)
|
| 13 |
+
return drives
|
| 14 |
+
|
| 15 |
+
def get_path_for_install():
|
| 16 |
+
language = get_system_language()
|
| 17 |
+
if not language:
|
| 18 |
+
language = input(get_localized_text("en", "choose_language")).strip().lower()
|
| 19 |
+
if language not in ["en", "ru"]:
|
| 20 |
+
language = "en"
|
| 21 |
+
|
| 22 |
+
default_path = "C:\\"
|
| 23 |
+
user_input = input(get_localized_text(language, "which_path") + f" ({default_path}): ").strip()
|
| 24 |
+
|
| 25 |
+
install_path = user_input if user_input else default_path
|
| 26 |
+
|
| 27 |
+
full_path = os.path.join(install_path, 'portablesource')
|
| 28 |
+
if not os.path.exists(full_path):
|
| 29 |
+
try:
|
| 30 |
+
os.makedirs(full_path)
|
| 31 |
+
except OSError:
|
| 32 |
+
print(get_localized_text(language, "error_creating_directory"))
|
| 33 |
+
return get_path_for_install()
|
| 34 |
+
|
| 35 |
+
with open(os.path.join(full_path, 'installed.txt'), 'w') as f:
|
| 36 |
+
f.write('installed')
|
| 37 |
+
|
| 38 |
+
return full_path
|
| 39 |
+
|
| 40 |
+
def get_install_path():
|
| 41 |
+
drives = get_available_drives()
|
| 42 |
+
install_path = None
|
| 43 |
+
for drive in drives:
|
| 44 |
+
possible_path = os.path.join(drive, 'portablesource', 'installed.txt')
|
| 45 |
+
if os.path.exists(possible_path):
|
| 46 |
+
install_path = os.path.dirname(possible_path)
|
| 47 |
+
return install_path
|
| 48 |
+
else:
|
| 49 |
+
install_path = get_path_for_install()
|
| 50 |
+
return install_path
|
| 51 |
+
return install_path
|
| 52 |
+
|
| 53 |
+
abs_path = get_install_path()
|
| 54 |
+
git = os.path.join(abs_path, "system", "git", "cmd", "git.exe")
|
| 55 |
+
ff_obs = os.path.join(abs_path, "sources", "facefusion")
|
| 56 |
+
master_path = os.path.join(ff_obs, "master")
|
| 57 |
+
python = os.path.join(abs_path, "sources", "facefusion", "venv", "Scripts", "python.exe")
|
| 58 |
+
|
| 59 |
+
def run_git_command(args):
|
| 60 |
+
subprocess.run([git] + args, check=True)
|
| 61 |
+
|
| 62 |
+
def update_branch(branch):
|
| 63 |
+
os.chdir(master_path)
|
| 64 |
+
run_git_command(['reset', '--hard'])
|
| 65 |
+
run_git_command(['checkout', 'master'])
|
| 66 |
+
run_git_command(['pull', 'origin', 'master', '--rebase'])
|
| 67 |
+
|
| 68 |
+
def start_ff(branch, webcam_mode=False):
|
| 69 |
+
path_to_branch = master_path
|
| 70 |
+
second_file = os.path.join(path_to_branch, "facefusion.py")
|
| 71 |
+
|
| 72 |
+
if webcam_mode:
|
| 73 |
+
args = ["run", "--open-browser", "--ui-layouts", "webcam"]
|
| 74 |
+
else:
|
| 75 |
+
args = ["run"]
|
| 76 |
+
|
| 77 |
+
cmd = f'"{python}" "{second_file}" {" ".join(args)}'
|
| 78 |
+
|
| 79 |
+
subprocess.run(cmd, shell=True, check=True)
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
def get_localized_text(language, key):
|
| 83 |
+
texts = {
|
| 84 |
+
"en": {
|
| 85 |
+
"choose_action": "Choose an action:",
|
| 86 |
+
"update_master": "1. Update to the master branch and start it",
|
| 87 |
+
"enter_choice": "Enter the number of the action: ",
|
| 88 |
+
"invalid_choice": "Invalid choice, please try again.",
|
| 89 |
+
"enable_webcam": "Enable webcam mode? (Y/N): ",
|
| 90 |
+
},
|
| 91 |
+
"ru": {
|
| 92 |
+
"choose_action": "Выберите действие:",
|
| 93 |
+
"update_master": "1. Обновить до обычной ветки и запустить ее (master)",
|
| 94 |
+
"enter_choice": "Введите номер действия: ",
|
| 95 |
+
"invalid_choice": "Неверный выбор, попробуйте снова.",
|
| 96 |
+
"enable_webcam": "Включить режим вебкамеры? (Y/N): ",
|
| 97 |
+
}
|
| 98 |
+
}
|
| 99 |
+
return texts[language].get(key, "")
|
| 100 |
+
|
| 101 |
+
def get_system_language():
|
| 102 |
+
try:
|
| 103 |
+
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Control Panel\International")
|
| 104 |
+
language = winreg.QueryValueEx(key, "LocaleName")[0]
|
| 105 |
+
winreg.CloseKey(key)
|
| 106 |
+
lang_code = language.split('-')[0].lower()
|
| 107 |
+
return "ru" if lang_code == "ru" else "en"
|
| 108 |
+
except WindowsError:
|
| 109 |
+
lang_code = locale.getdefaultlocale()[0].split('_')[0].lower()
|
| 110 |
+
return "ru" if lang_code == "ru" else "en"
|
| 111 |
+
|
| 112 |
+
def ask_webcam_mode(language):
|
| 113 |
+
webcam_choice = input(get_localized_text(language, "enable_webcam")).strip().lower()
|
| 114 |
+
return webcam_choice == 'y'
|
| 115 |
+
|
| 116 |
+
def facefusion():
|
| 117 |
+
language = get_system_language()
|
| 118 |
+
if not language:
|
| 119 |
+
language = input(get_localized_text("en", "choose_language")).strip().lower()
|
| 120 |
+
if language not in ["en", "ru"]:
|
| 121 |
+
language = "en"
|
| 122 |
+
while True:
|
| 123 |
+
print(get_localized_text(language, "choose_action"))
|
| 124 |
+
print(get_localized_text(language, "update_master"))
|
| 125 |
+
choice = input(get_localized_text(language, "enter_choice")).strip()
|
| 126 |
+
|
| 127 |
+
if choice == '1':
|
| 128 |
+
update_branch('master')
|
| 129 |
+
webcam_mode = ask_webcam_mode(language)
|
| 130 |
+
start_ff("master", webcam_mode)
|
| 131 |
+
else:
|
| 132 |
+
print(get_localized_text(language, "invalid_choice"))
|
| 133 |
+
|
| 134 |
+
if __name__ == "__main__":
|
| 135 |
+
facefusion()
|