Skip to content

Commit

Permalink
add an option to not overlay original image for inpainting for #14727
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Jan 23, 2024
1 parent bac30eb commit de5a8c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,13 @@ def infotext(index=0, use_main_prompt=False):
image = pp.image

mask_for_overlay = getattr(p, "mask_for_overlay", None)
overlay_image = p.overlay_images[i] if getattr(p, "overlay_images", None) is not None and i < len(p.overlay_images) else None

if not shared.opts.overlay_inpaint:
overlay_image = None
elif getattr(p, "overlay_images", None) is not None and i < len(p.overlay_images):
overlay_image = p.overlay_images[i]
else:
overlay_image = None

if p.scripts is not None:
ppmo = scripts.PostProcessMaskOverlayArgs(i, mask_for_overlay, overlay_image)
Expand Down
1 change: 1 addition & 0 deletions modules/shared_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
"return_mask": OptionInfo(False, "For inpainting, include the greyscale mask in results for web"),
"return_mask_composite": OptionInfo(False, "For inpainting, include masked composite in results for web"),
"img2img_batch_show_results_limit": OptionInfo(32, "Show the first N batch img2img results in UI", gr.Slider, {"minimum": -1, "maximum": 1000, "step": 1}).info('0: disable, -1: show all images. Too many images can cause lag'),
"overlay_inpaint": OptionInfo(True, "Overlay original for inpaint").info("when inpainting, overlay the original image over the areas that weren't inpainted."),
}))

options_templates.update(options_section(('optimizations', "Optimizations", "sd"), {
Expand Down

0 comments on commit de5a8c5

Please sign in to comment.