Merge pull request #83 from glucauze/v1.2.6

fix inpainting in auto dev version
main
Tran Xen 2 years ago committed by GitHub
commit 0d0242e0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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.

@ -7,13 +7,6 @@ from packaging.version import parse
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")

@ -52,6 +52,7 @@ inpainting_steps : {options.inpainting_steps}
)
i2i_kwargs = {
"init_images": [img],
"sampler_name": options.inpainting_sampler,
"do_not_save_samples": True,
"steps": options.inpainting_steps,
@ -65,16 +66,6 @@ inpainting_steps : {options.inpainting_steps}
"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 @@ inpainting_steps : {options.inpainting_steps}
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

@ -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

Loading…
Cancel
Save