Merge pull request from glucauze/v1.2.1

add warning on improved mask and upscaling and make it disabled in settings by default
main
Tran Xen 2 years ago committed by GitHub
commit c835e97485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -201,7 +201,7 @@ def on_ui_settings() -> None:
shared.opts.add_option(
"faceswaplab_default_upscaled_swapper_improved_mask",
shared.OptionInfo(
True,
False,
"Default Use improved segmented mask (use pastenet to mask only the face) (requires restart)",
gr.Checkbox,
{"interactive": True},

@ -210,6 +210,11 @@ class UpscaledINSwapper(INSwapper):
)
if options.improved_mask:
if k == 1:
logger.warning(
"Please note that improved mask does not work well without upscaling. Set upscaling to Lanczos at least if you want speed and want to use improved mask."
)
logger.info("improved_mask")
mask = get_face_mask(aimg, bgr_fake)
bgr_fake = merge_images_with_mask(aimg, bgr_fake, mask)

Loading…
Cancel
Save