diff --git a/preload.py b/preload.py index 983e711..5c3eaf5 100644 --- a/preload.py +++ b/preload.py @@ -8,8 +8,3 @@ def preload(parser: ArgumentParser) -> None: choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"], help="Set the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)", ) - parser.add_argument( - "--faceswaplab_gpu", - action="store_true", - help="Enable GPU if set, disable if not set", - ) diff --git a/scripts/faceswaplab.py b/scripts/faceswaplab.py index 6bfa3a2..4aff3f5 100644 --- a/scripts/faceswaplab.py +++ b/scripts/faceswaplab.py @@ -111,9 +111,6 @@ def ui(self, is_img2img: bool) -> List[gr.components.Component]: # If the order is modified, the before_process should be changed accordingly. components = components + post_processing - # Ask sd to not store in ui-config.json - for component in components: - setattr(component, "do_not_save_to_config", True) return components diff --git a/scripts/faceswaplab_globals.py b/scripts/faceswaplab_globals.py index a25fae0..46f3965 100644 --- a/scripts/faceswaplab_globals.py +++ b/scripts/faceswaplab_globals.py @@ -16,7 +16,7 @@ ) # Defining the version flag for the application -VERSION_FLAG: str = "v1.2.3" +VERSION_FLAG: str = "v1.2.4" # Defining the path for 'sd-webui-faceswaplab' inside the 'extensions' directory EXTENSION_PATH = os.path.join("extensions", "sd-webui-faceswaplab") diff --git a/scripts/faceswaplab_inpainting/i2i_pp.py b/scripts/faceswaplab_inpainting/i2i_pp.py index 61a4850..1826949 100644 --- a/scripts/faceswaplab_inpainting/i2i_pp.py +++ b/scripts/faceswaplab_inpainting/i2i_pp.py @@ -63,16 +63,18 @@ def img2img_diffusion( "prompt": prompt, "negative_prompt": negative_prompt, "denoising_strength": options.inpainting_denoising_strengh, - "override_settings": { - "return_mask_composite": False, - "save_images_before_face_restoration": False, - "save_images_before_highres_fix": False, - "save_images_before_color_correction": False, - "save_mask": False, - "save_mask_composite": False, - "samples_save": False, - }, } + # Remove the following as they are not always supported on all platform : + # "override_settings": { + # "return_mask_composite": False, + # "save_images_before_face_restoration": False, + # "save_images_before_highres_fix": False, + # "save_images_before_color_correction": False, + # "save_mask": False, + # "save_mask_composite": False, + # "samples_save": False, + # }, + current_model_checkpoint = shared.opts.sd_model_checkpoint if options.inpainting_model and options.inpainting_model != "Current": # Change checkpoint diff --git a/scripts/faceswaplab_ui/faceswaplab_inpainting_ui.py b/scripts/faceswaplab_ui/faceswaplab_inpainting_ui.py index 052fa17..8bb7180 100644 --- a/scripts/faceswaplab_ui/faceswaplab_inpainting_ui.py +++ b/scripts/faceswaplab_ui/faceswaplab_inpainting_ui.py @@ -65,4 +65,7 @@ def face_inpainting_ui( inpaiting_model, ] + for component in gradio_components: + setattr(component, "do_not_save_to_config", True) + return gradio_components diff --git a/scripts/faceswaplab_ui/faceswaplab_unit_ui.py b/scripts/faceswaplab_ui/faceswaplab_unit_ui.py index 8c00b93..20dbacf 100644 --- a/scripts/faceswaplab_ui/faceswaplab_unit_ui.py +++ b/scripts/faceswaplab_ui/faceswaplab_unit_ui.py @@ -80,7 +80,7 @@ def faceswap_unit_advanced_options( elem_id=f"{id_prefix}_face{unit_num}_erosion_factor", ) - return [ + components = [ face_restorer_name, face_restorer_visibility, codeformer_weight, @@ -91,6 +91,11 @@ def faceswap_unit_advanced_options( erosion_factor, ] + for component in components: + setattr(component, "do_not_save_to_config", True) + + return components + def faceswap_unit_ui( is_img2img: bool, unit_num: int = 1, id_prefix: str = "faceswaplab" @@ -281,10 +286,6 @@ def refresh_fn(selected: str): + post_inpainting ) - # Ask sd to not store in ui-config.json - for component in gradio_components: - setattr(component, "do_not_save_to_config", True) - # If changed, you need to change FaceSwapUnitSettings accordingly # ORDER of parameters is IMPORTANT. It should match the result of FaceSwapUnitSettings return gradio_components