stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Inpainting affects unmasked areas

Open kraddoc opened this issue 1 year ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

Inpainting heavily degrades image quality and adds heavy blurriness in the unmasked area, no matter the settings. It's not connected to mask not being cleared out properly, as the bug occurs even in the fresh installation. The effect on unmasked areas always stays the same, no matter the settings, sampling method, resolution etc.

Before and after results, with mask applied only to extra arm:

The settings used, among many: Screenshot-2023-06-08-160636

Steps to reproduce the problem

  1. Go to inpainting
  2. Add a mask to the image
  3. Press generate

What should have happened?

Image regenerated with only the mask area affected.

Commit where the problem happens

ebf229bd1727a0f8f0d149829ce82e2012ba7318

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

AMD GPUs (RX 6000 above)

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--medvram --precision full --no-half --no-half-vae --opt-split-attention --opt-sub-quad-attention --disable-nan-check

List of extensions

Adetailer. The problem persists without it.

Console logs

venv "D:\Data\Stable DIffusion\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: <none>
Commit hash: ebf229bd1727a0f8f0d149829ce82e2012ba7318
Installing requirements

Launching Web UI with arguments: --medvram --precision full --no-half --no-half-vae --opt-split-attention --opt-sub-quad-attention --disable-nan-check
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
[-] ADetailer initialized. version: 23.6.2, num models: 8
Checkpoint sxzLuma_099VAE.safetensors [b4e58922cc] not found; loading fallback allboymix.safetensors [9694b69e2b]
Loading weights [9694b69e2b] from D:\Data\Stable DIffusion\stable-diffusion-webui-directml\models\Stable-diffusion\allboymix.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 7.3s (import torch: 1.7s, import gradio: 1.2s, import ldm: 0.5s, other imports: 0.8s, load scripts: 2.0s, create ui: 0.5s, gradio launch: 0.4s).
Creating model from config: D:\Data\Stable DIffusion\stable-diffusion-webui-directml\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying optimization: Doggettx... done.
Textual inversion embeddings loaded(4): badhandv4, easynegative, negative_hand-neg, verybadimagenegative_v1.3
Model loaded in 3.8s (load weights from disk: 1.1s, create model: 0.3s, apply weights to model: 2.3s).
100%|██████████████████████████████████████████████████████████████████████████████████| 16/16 [01:58<00:00,  7.38s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 16/16 [01:53<00:00,  7.11s/it]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 16/16 [01:53<00:00,  6.58s/it]

Additional information

I have 8 gb VRAM rx 6600, if that's relevant.

kraddoc avatar Jun 08 '23 13:06 kraddoc

I have found that if you click the reset paint button(you will see the "start drawing" text appear) before each edit, it will stick to the mask.

GunnyNinja avatar Jun 10 '23 17:06 GunnyNinja

This is due to mask_blur Set mask_blur to zero Try to increase the masked padding pixels till 100

Anchaliya75 avatar Jun 10 '23 19:06 Anchaliya75

I have found that if you click the reset paint button(you will see the "start drawing" text appear) before each edit, it will stick to the mask.

No effect on the issue.

This is due to mask_blur Set mask_blur to zero Try to increase the masked padding pixels till 100

Setting mask blur to zero doesn't solve the issue. Changing padding doesn't do anything either.

Interestingly enough, inpainting non-masked setting actually behaves correctly.

kraddoc avatar Jun 11 '23 15:06 kraddoc

I'm getting this also, since a recent update - 100% clearing the mask and still getting other parts of the image effected. I can mitigate the issue by spinning up a new window however once I start working will get 'ghost' selections appear.

N-Soder avatar Jun 14 '23 02:06 N-Soder

I have found that if you click the reset paint button(you will see the "start drawing" text appear) before each edit, it will stick to the mask.

Yes this seems to be the work around but previous versions would clear the mask each time you sent an imagine to in paint so you could iterate with each version getting closer to the desired outcome. Problem is you don't know if it has cleared it or not until parts of image start changing that you've already changed.

Marc2629 avatar Jun 20 '23 08:06 Marc2629

I have found that if you click the reset paint button(you will see the "start drawing" text appear) before each edit, it will stick to the mask.

Yes this seems to be the work around but previous versions would clear the mask each time you sent an imagine to in paint so you could iterate with each version getting closer to the desired outcome. Problem is you don't know if it has cleared it or not until parts of image start changing that you've already changed.

You know it's cleared if you see "Start Drawing". I have gotten in the habit of just resetting it each time.

GunnyNinja avatar Jun 21 '23 04:06 GunnyNinja