From b96fbd8f95f1fd9ac51e0250bc684a018943a31f Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 14 Dec 2023 10:09:55 -0500 Subject: [PATCH] add img2img_apply_overlay --- CHANGELOG.md | 18 ++++++++++-------- extensions-builtin/sd-extension-system-info | 2 +- modules/processing.py | 2 ++ modules/shared.py | 6 ++++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4198185dd..0acc17d68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Change Log for SD.Next -## Update for 2023-12-09 +## Update for 2023-12-14 *Note*: based on `diffusers==0.25.0.dev0` @@ -36,16 +36,18 @@ - **CivitAI downloader** allow usage of access tokens for download of gated or private models - **Extra networks** new *settting -> extra networks -> build info on first access* indexes all networks on first access instead of server startup - - **IPEX** - - Update to **Torch 2.1**, thanks @disty0 - - Built-in *MKL* and *DPCPP* for IPEX, thanks @disty0 - No need to install OneAPI anymore - - Fix IPEX Optimize not applying with Diffusers backend, thanks @disty0 - - Disable 32 bit workarounds if the GPU supports 64 bit, thanks @disty0 - - More compatibility improvements, thanks @disty0 + - **IPEX**, thanks @disty0 + - update to **Torch 2.1** + - built-in *MKL* and *DPCPP* for IPEX + no need to install OneAPI anymore + - fix IPEX Optimize not applying with Diffusers backend + - disable 32 bit workarounds if the GPU supports 64 bit + - compatibility improvements - **OpenVINO** - Add *Directory for OpenVINO cache* option to *System Paths*, thanks @disty0 - Remove Intel ARC specific 1024x1024 workaround, thanks @disty0 + - **Inpaint** add option `apply_overlay` to control if inpaint result should be applied as overlay or as-is + can remove artifacts and hard edges of inpaint area but also remove some details from original - disable google fonts check on server startup - fix torchvision/basicsr compatibility - fix extra networks sort diff --git a/extensions-builtin/sd-extension-system-info b/extensions-builtin/sd-extension-system-info index 1841cf762..ce1b2a4a1 160000 --- a/extensions-builtin/sd-extension-system-info +++ b/extensions-builtin/sd-extension-system-info @@ -1 +1 @@ -Subproject commit 1841cf7627d3991d7ba3dfe8b86a14b18f78f933 +Subproject commit ce1b2a4a10eb25d33d716132a209599cb3733164 diff --git a/modules/processing.py b/modules/processing.py index 0bd8788e7..31170d8d5 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -61,6 +61,8 @@ def apply_color_correction(correction, original_image): def apply_overlay(image: Image, paste_loc, index, overlays): + if not shared.opts.img2img_apply_overlay: + return image if overlays is None or index >= len(overlays): return image overlay = overlays[index] diff --git a/modules/shared.py b/modules/shared.py index 3b9e4fbd5..6ef5d382c 100644 --- a/modules/shared.py +++ b/modules/shared.py @@ -545,9 +545,11 @@ options_templates.update(options_section(('sampler-params', "Sampler Settings"), options_templates.update(options_section(('postprocessing', "Postprocessing"), { 'postprocessing_enable_in_main_ui': OptionInfo([], "Enable additional postprocessing operations", ui_components.DropdownMulti, lambda: {"choices": [x.name for x in shared_items.postprocessing_scripts()]}), 'postprocessing_operation_order': OptionInfo([], "Postprocessing operation order", ui_components.DropdownMulti, lambda: {"choices": [x.name for x in shared_items.postprocessing_scripts()]}), + "postprocessing_sep_img2img": OptionInfo("

Img2Img & Inpainting

", "", gr.HTML), - "img2img_color_correction": OptionInfo(False, "Apply color correction to match original colors"), - "img2img_fix_steps": OptionInfo(False, "For image processing do exact number of steps as specified"), + "img2img_color_correction": OptionInfo(False, "Apply color correction"), + "img2img_apply_overlay": OptionInfo(False, "Apply result as overlay"), + "img2img_fix_steps": OptionInfo(False, "For image processing do exact number of steps as specified", gr.Checkbox, { "visible": False }), "img2img_background_color": OptionInfo("#ffffff", "Image transparent color fill", ui_components.FormColorPicker, {}), "inpainting_mask_weight": OptionInfo(1.0, "Inpainting conditioning mask strength", gr.Slider, {"minimum": 0.0, "maximum": 1.0, "step": 0.01}), "initial_noise_multiplier": OptionInfo(1.0, "Noise multiplier for image processing", gr.Slider, {"minimum": 0.1, "maximum": 1.5, "step": 0.01}),