diff --git a/README.md b/README.md index 53dcc46..cd3f800 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ logo - ![Version](https://img.shields.io/badge/version-0.6.0_alpha3-lightgreen?style=for-the-badge&labelColor=darkgreen) + ![Version](https://img.shields.io/badge/version-0.6.0_alpha4-lightgreen?style=for-the-badge&labelColor=darkgreen) Support Me on Boosty diff --git a/README_RU.md b/README_RU.md index 77ed941..294ad57 100644 --- a/README_RU.md +++ b/README_RU.md @@ -2,7 +2,7 @@ logo - ![Version](https://img.shields.io/badge/версия-0.6.0_alpha3-lightgreen?style=for-the-badge&labelColor=darkgreen) + ![Version](https://img.shields.io/badge/версия-0.6.0_alpha4-lightgreen?style=for-the-badge&labelColor=darkgreen) Поддержать проект на Boosty diff --git a/scripts/reactor_faceswap.py b/scripts/reactor_faceswap.py index 783c68c..1a45fab 100644 --- a/scripts/reactor_faceswap.py +++ b/scripts/reactor_faceswap.py @@ -28,6 +28,7 @@ from scripts.console_log_patch import apply_logging_patch from scripts.reactor_helpers import ( make_grid, set_Device, + get_SDNEXT ) from scripts.reactor_globals import SWAPPER_MODELS_PATH #, DEVICE, DEVICE_LIST @@ -50,6 +51,10 @@ class FaceSwapScript(scripts.Script): # def on_files_clear(): # clear_faces_list() # return gr.Checkbox.update(value=SAVE_ORIGINAL,visible=True) + + # SD.Next fix + if get_SDNEXT(): + enable = gr.Checkbox(False, label="Enable") # enable = gr.Checkbox(False, label="Enable", info=f"The Fast and Simple FaceSwap Extension - {version_flag}") gr.Markdown(f"The Fast and Simple FaceSwap Extension - {version_flag}") @@ -408,6 +413,10 @@ class FaceSwapScriptExtras(scripts_postprocessing.ScriptPostprocessing): def ui(self): with ui_components.InputAccordion(False, label=f"{app_title}") as enable: # with gr.Accordion(f"{app_title}", open=False): + + # SD.Next fix + if get_SDNEXT(): + enable = gr.Checkbox(False, label="Enable") # enable = gr.Checkbox(False, label="Enable", info=f"The Fast and Simple FaceSwap Extension - {version_flag}") gr.Markdown(f"The Fast and Simple FaceSwap Extension - {version_flag}") diff --git a/scripts/reactor_globals.py b/scripts/reactor_globals.py index 7e8f4dc..81d123d 100644 --- a/scripts/reactor_globals.py +++ b/scripts/reactor_globals.py @@ -18,6 +18,8 @@ SWAPPER_MODELS_PATH = os.path.join(MODELS_PATH, "insightface") REACTOR_MODELS_PATH = os.path.join(MODELS_PATH, "reactor") FACE_MODELS_PATH = os.path.join(REACTOR_MODELS_PATH, "faces") +IS_SDNEXT = False + if not os.path.exists(REACTOR_MODELS_PATH): os.makedirs(REACTOR_MODELS_PATH) if not os.path.exists(FACE_MODELS_PATH): diff --git a/scripts/reactor_helpers.py b/scripts/reactor_helpers.py index 2db883d..0290425 100644 --- a/scripts/reactor_helpers.py +++ b/scripts/reactor_helpers.py @@ -11,7 +11,7 @@ from insightface.app.common import Face from modules.images import FilenameGenerator, get_next_sequence_number from modules import shared, script_callbacks -from scripts.reactor_globals import DEVICE, BASE_PATH, FACE_MODELS_PATH +from scripts.reactor_globals import DEVICE, BASE_PATH, FACE_MODELS_PATH, IS_SDNEXT try: from modules.paths_internal import models_path @@ -33,6 +33,14 @@ def get_Device(): global DEVICE return DEVICE +def set_SDNEXT(): + global IS_SDNEXT + IS_SDNEXT = True + +def get_SDNEXT(): + global IS_SDNEXT + return IS_SDNEXT + def make_grid(image_list: List): # Count the occurrences of each image size in the image_list diff --git a/scripts/reactor_swapper.py b/scripts/reactor_swapper.py index 0f70bb2..c92cae4 100644 --- a/scripts/reactor_swapper.py +++ b/scripts/reactor_swapper.py @@ -17,7 +17,8 @@ from scripts.reactor_helpers import ( save_face_model, load_face_model, get_images_from_folder, - get_images_from_list + get_images_from_list, + set_SDNEXT ) from scripts.console_log_patch import apply_logging_patch @@ -26,6 +27,7 @@ try: # A1111 from modules import codeformer_model, gfpgan_model except: # SD.Next from modules.postprocess import codeformer_model, gfpgan_model + set_SDNEXT() from modules.upscaler import UpscalerData from modules.shared import state from scripts.reactor_logger import logger diff --git a/scripts/reactor_version.py b/scripts/reactor_version.py index f590633..85adc92 100644 --- a/scripts/reactor_version.py +++ b/scripts/reactor_version.py @@ -1,5 +1,5 @@ app_title = "ReActor" -version_flag = "v0.6.0-a3" +version_flag = "v0.6.0-a4" from scripts.reactor_logger import logger, get_Run, set_Run