diff --git a/README.md b/README.md index 4da4b14..c68246c 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,32 @@ More on this here : https://glucauze.github.io/sd-webui-faceswaplab/ ## Quick Start +Here are some gifs to explain (non cherry picked, just random pictures) : + +## Simple Usage (roop like) + +This use codeformer on all faces (including non swapped) + +[simple.webm](https://github.com/glucauze/sd-webui-faceswaplab/assets/137925069/de00b685-d441-44f9-bae3-71cd7abef113) + +## Advanced options + +This is use to improve results. This use upscaling and codeformer only on swapped faces + +[advanced.webm](https://github.com/glucauze/sd-webui-faceswaplab/assets/137925069/50630311-bd25-487f-871b-0a44eecd435d) + +## Inpainting + +This add inpainting on faces : + +[inpainting.webm](https://github.com/glucauze/sd-webui-faceswaplab/assets/137925069/3d3508e9-5be4-4566-8c41-8301b2d08355) + +## Build and use checkpoints : + +[build.webm](https://github.com/glucauze/sd-webui-faceswaplab/assets/137925069/e84e9a3c-840d-4536-9fbb-09ed256406d7) + + + ### Simple 1. Put a face in the reference. diff --git a/install.py b/install.py index 3cd5a10..7b82180 100644 --- a/install.py +++ b/install.py @@ -7,13 +7,6 @@ def check_install() -> None: use_gpu = True - try: - from modules import shared - - use_gpu = not getattr(shared.cmd_opts, "use-cpu", False) - except: - # On some platform previous lines may failed (modules.shared not initialized), just ignore and use GPU requirements - pass if use_gpu and sys.platform != "darwin": print("Faceswaplab : Use GPU requirements") diff --git a/scripts/faceswaplab_inpainting/i2i_pp.py b/scripts/faceswaplab_inpainting/i2i_pp.py index 4daa41c..d9295cc 100644 --- a/scripts/faceswaplab_inpainting/i2i_pp.py +++ b/scripts/faceswaplab_inpainting/i2i_pp.py @@ -52,6 +52,7 @@ def img2img_diffusion( ) i2i_kwargs = { + "init_images": [img], "sampler_name": options.inpainting_sampler, "do_not_save_samples": True, "steps": options.inpainting_steps, @@ -65,16 +66,6 @@ def img2img_diffusion( "denoising_strength": options.inpainting_denoising_strengh, "seed": options.inpainting_seed, } - # 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": @@ -82,7 +73,7 @@ def img2img_diffusion( shared.opts.sd_model_checkpoint = options.inpainting_model sd_models.select_checkpoint sd_models.load_model() - i2i_p = StableDiffusionProcessingImg2Img([img], **i2i_kwargs) + i2i_p = StableDiffusionProcessingImg2Img(**i2i_kwargs) i2i_processed = processing.process_images(i2i_p) if options.inpainting_model and options.inpainting_model != "Current": # Restore checkpoint diff --git a/scripts/faceswaplab_ui/faceswaplab_postprocessing_ui.py b/scripts/faceswaplab_ui/faceswaplab_postprocessing_ui.py index e173c92..25a3383 100644 --- a/scripts/faceswaplab_ui/faceswaplab_postprocessing_ui.py +++ b/scripts/faceswaplab_ui/faceswaplab_postprocessing_ui.py @@ -1,7 +1,6 @@ from typing import List import gradio as gr -import modules -from modules import shared, sd_models +from modules import shared from scripts.faceswaplab_postprocessing.postprocessing_options import InpaintingWhen from scripts.faceswaplab_utils.sd_utils import get_sd_option from scripts.faceswaplab_ui.faceswaplab_inpainting_ui import face_inpainting_ui