AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
138.32k stars 26.28k forks source link

[Bug]: Inpainting gives more or less SAME result as the input image #11114

Open lingcong-k opened 1 year ago

lingcong-k commented 1 year ago

Is there an existing issue for this?

What happened?

Inpainting gives the same result as input image

I want a seaside view in the masked area, but i got the same white bg as the input image

But if I do in the official stable diffusion inpainting huggingface space, it works fine. (same checkpoint and image) image

Steps to reproduce the problem

  1. use the stable diffusion 1.5 inpainting model
  2. input an image with a pure white background
  3. do inpainting

What should have happened?

It should give what I described in the text prompt

Commit where the problem happens

https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/18acc0b30d9184702a772287ed8197385e0aed98

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Linux

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No

List of extensions

image

Console logs

Launching Web UI with arguments: 
No module 'xformers'. Proceeding without it.
ControlNet v1.1.191
ControlNet v1.1.191
Loading weights [c6bbc15e32] from /home/workspace/difusion_models/stable-diffusion-webui/models/Stable-diffusion/sd-v1-5-inpainting.ckpt
Create LRU cache (max_size=16) for preprocessor results.
Create LRU cache (max_size=16) for preprocessor results.
preload_extensions_git_metadata for 8 extensions took 0.07s
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Create LRU cache (max_size=16) for preprocessor results.
Startup time: 3.3s (import torch: 0.9s, import gradio: 0.7s, import ldm: 0.3s, other imports: 0.5s, load scripts: 0.4s, create ui: 0.3s).
Creating model from config: /home/workspace/difusion_models/stable-diffusion-webui/configs/v1-inpainting-inference.yaml
LatentInpaintDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.54 M params.
Applying attention optimization: Doggettx... done.
Textual inversion embeddings loaded(0): 
Model loaded in 4.4s (load weights from disk: 3.1s, create model: 0.3s, apply weights to model: 0.5s, apply half(): 0.3s, move model to device: 0.2s).
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:03<00:00,  5.12it/s]
Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:02<00:00,  6.15it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:02<00:00,  6.32it/s]
Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:02<00:00,  6.25it/s]
Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:02<00:00,  6.33it/s]

Additional information

No response

neph1 commented 1 year ago

What settings did you use? I suggest setting 'Denoising Strength' to 1.00 and 'Masked Content' to 'latent noise'. Behold, my PCB by the sea: 00027-307753128

lingcong-k commented 1 year ago

What settings did you use? I suggest setting 'Denoising Strength' to 1.00 and 'Masked Content' to 'latent noise'. Behold, my PCB by the sea: 00027-307753128

thanks for your reply. :) Yes, latent noise seems work well, i was using original. Is it latent noise are generally preferred over other options?

neph1 commented 1 year ago

Depends on what you want to do. Fill: Fills with the average color of the image Original: Keeps the original colors of the pixels Latent noise: Google some images of what it looks like

In this case you want to drastically change the background to something not present in the image, so Fill, or Original are not good options. Latent nothing might have worked well, too, but I imagine it would take a few more iterations to get a result? :shrug:

Edit: I suggest you close the issue.

lingcong-k commented 1 year ago

Depends on what you want to do. Fill: Fills with the average color of the image Original: Keeps the original colors of the pixels Latent noise: Google some images of what it looks like

In this case you want to drastically change the background to something not present in the image, so Fill, or Original are not good options. Latent nothing might have worked well, too, but I imagine it would take a few more iterations to get a result? shrug

Edit: I suggest you close the issue.

hey @neph1 Thanks for your reply.
Sorry for the late response. I played around a bit more and i found set denoising to 1 sometimes gave weird results like full black. So i have to lower the denoising to sth lower like 0.5-

Yeah thanks for the suggestions, I want to try a bit more before closing the issue.