8 Commits
next ... main

Author SHA1 Message Date
Kenneth Estanislao
4324b41b9e Update ui.py
hides NSFW button
2024-08-15 03:03:57 +08:00
Kenneth Estanislao
a6e00211f0 Merge pull request #321 from gianpaj/stop-live-mode-if-preview-is-closed
Stop live mode when the preview window is closed
2024-08-15 03:01:37 +08:00
Gianfranco Palumbo
99214c7ab1 Stop live mode the preview window is closed 2024-08-14 17:52:42 +02:00
Kenneth Estanislao
080d6f5110 Merge pull request #282 from jasonkneen/main-macos-metal-gpu-optimisation
macOS optimisations for Silicon Macs for GPU / Metal usage (reduced CPU load from 600% to 150%)
2024-08-13 20:30:26 +08:00
Jason Kneen
155546b937 Update .gitignore 2024-08-13 13:23:13 +01:00
Kenneth Estanislao
79fbb7998c Merge pull request #281 from snewell92/patch-1 2024-08-13 20:09:04 +08:00
Sean Newell
5ce2fd298b sourcery update
Grammar updates

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2024-08-13 14:03:05 +02:00
Sean Newell
740410dd73 Strengthen ethical consideration
Nothing we say is legally binding in here, but it
behooves us to be stronger in our language - getting consent
to be digitally reproduced should be required
and standard procedure.
2024-08-13 13:50:02 +02:00
4 changed files with 16 additions and 13 deletions

3
.gitignore vendored
View File

@@ -6,13 +6,14 @@ __pycache__/
.todo
*.log
*.backup
tf_env/
*.png
*.mp4
*.mkv
.tmp/
temp/
.venv/
venv/
env/
workflow/

View File

@@ -6,7 +6,7 @@ This software is meant to be a productive contribution to the rapidly growing AI
The developers of this software are aware of its possible unethical applications and are committed to take preventative measures against them. It has a built-in check which prevents the program from working on inappropriate media including but not limited to nudity, graphic content, sensitive material such as war footage etc. We will continue to develop this project in the positive direction while adhering to law and ethics. This project may be shut down or include watermarks on the output if requested by law.
Users of this software are expected to use this software responsibly while abiding the local law. If face of a real person is being used, users are suggested to get consent from the concerned person and clearly mention that it is a deepfake when posting content online. Developers of this software will not be responsible for actions of end-users.
Users of this software are expected to use this software responsibly while abiding by local laws. If the face of a real person is being used, users are required to get consent from the concerned person and clearly mention that it is a deepfake when posting content online. Developers of this software will not be responsible for actions of end-users.
## How do I install it?

View File

@@ -74,7 +74,7 @@ def parse_args() -> None:
modules.globals.fp_ui['face_enhancer'] = True
else:
modules.globals.fp_ui['face_enhancer'] = False
modules.globals.nsfw = False
# translate deprecated args
@@ -165,7 +165,6 @@ def update_status(message: str, scope: str = 'DLC.CORE') -> None:
if not modules.globals.headless:
ui.update_status(message)
def start() -> None:
for frame_processor in get_frame_processors_modules(modules.globals.frame_processors):
if not frame_processor.pre_start():

View File

@@ -61,11 +61,11 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C
target_label = ctk.CTkLabel(root, text=None)
target_label.place(relx=0.6, rely=0.1, relwidth=0.3, relheight=0.25)
source_button = ctk.CTkButton(root, text='Select a face', cursor='hand2', command=lambda: select_source_path())
source_button.place(relx=0.1, rely=0.4, relwidth=0.3, relheight=0.1)
select_face_button = ctk.CTkButton(root, text='Select a face', cursor='hand2', command=lambda: select_source_path())
select_face_button.place(relx=0.1, rely=0.4, relwidth=0.3, relheight=0.1)
target_button = ctk.CTkButton(root, text='Select a target', cursor='hand2', command=lambda: select_target_path())
target_button.place(relx=0.6, rely=0.4, relwidth=0.3, relheight=0.1)
select_target_button = ctk.CTkButton(root, text='Select a target', cursor='hand2', command=lambda: select_target_path())
select_target_button.place(relx=0.6, rely=0.4, relwidth=0.3, relheight=0.1)
keep_fps_value = ctk.BooleanVar(value=modules.globals.keep_fps)
keep_fps_checkbox = ctk.CTkSwitch(root, text='Keep fps', variable=keep_fps_value, cursor='hand2', command=lambda: setattr(modules.globals, 'keep_fps', not modules.globals.keep_fps))
@@ -88,9 +88,9 @@ def create_root(start: Callable[[], None], destroy: Callable[[], None]) -> ctk.C
many_faces_switch = ctk.CTkSwitch(root, text='Many faces', variable=many_faces_value, cursor='hand2', command=lambda: setattr(modules.globals, 'many_faces', many_faces_value.get()))
many_faces_switch.place(relx=0.6, rely=0.65)
nsfw_value = ctk.BooleanVar(value=modules.globals.nsfw)
nsfw_switch = ctk.CTkSwitch(root, text='NSFW', variable=nsfw_value, cursor='hand2', command=lambda: setattr(modules.globals, 'nsfw', nsfw_value.get()))
nsfw_switch.place(relx=0.6, rely=0.7)
# nsfw_value = ctk.BooleanVar(value=modules.globals.nsfw)
# nsfw_switch = ctk.CTkSwitch(root, text='NSFW', variable=nsfw_value, cursor='hand2', command=lambda: setattr(modules.globals, 'nsfw', nsfw_value.get()))
# nsfw_switch.place(relx=0.6, rely=0.7)
start_button = ctk.CTkButton(root, text='Start', cursor='hand2', command=lambda: select_output_path(start))
start_button.place(relx=0.15, rely=0.80, relwidth=0.2, relheight=0.05)
@@ -253,7 +253,7 @@ def webcam_preview():
if modules.globals.source_path is None:
# No image selected
return
global preview_label, PREVIEW
cap = cv2.VideoCapture(0) # Use index for the webcam (adjust the index accordingly if necessary)
@@ -292,5 +292,8 @@ def webcam_preview():
preview_label.configure(image=image)
ROOT.update()
if PREVIEW.state() == 'withdrawn':
break
cap.release()
PREVIEW.withdraw() # Close preview window when loop is finished
PREVIEW.withdraw() # Close preview window when loop is finished