lllyasviel / lllyasviel/stable-diffusion-webui-forge

[Bug]: The 'Inpaint not masked' feature of IMG2IMG does not work in conjunction with Inpaint-ControlNET

Open
#352 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [X] The issue exists after disabling all extensions
- [ ] The issue exists on a clean installation of webui
- [X] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [X] The issue exists in the current version of the webui
- [X] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

When using Inpaint not masked together with Controlnet-Inpainting, the image will not undergo any changes.

[ Inpaint not masked In img2img tab ]
[ Original image , Controlnet-Inpainting , Non-ControlNET ]

![123](https://github.com/lllyasviel/stable-diffusion-webui-forge/assets/101268214/33fbd3f2-e854-4395-ad02-0b2c6d39cf59)

### Steps to reproduce the problem

Use ControlNET-Inpainting with inpaint not masked.

### What should have happened?

You can use Controlnet-Inpaint together with a mask as usual.

### What browsers do you use to access the UI ?

Google Chrome

### Sysinfo

[sysinfo-2024-02-21-07-37.json](https://github.com/lllyasviel/stable-diffusion-webui-forge/files/14355919/sysinfo-2024-02-21-07-37.json)

### Console logs

```Shell
Already up to date.
venv "E:\AI Gen\stable-diffusion-webui-forge\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: f0.0.14v1.8.0rc-latest-186-ge5b7fdf2
Commit hash: e5b7fdf227bbb85951e1ac792faff802ee549949
loading WD14-tagger reqs from E:\AI Gen\stable-diffusion-webui-forge\extensions\stable-diffusion-webui-wd14-tagger\requirements.txt
Checking WD14-tagger requirements.
Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\a-person-mask-generator':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\a1111-sd-webui-tagcomplete':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\adetailer':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\canvas-zoom':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\sd-webui-aspect-ratio-helper':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\sd-webui-cd-tuner':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\sd-webui-negpip':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\sd-webui-segment-anything':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\sdwebui-close-confirmation-dialogue':
Already up to date.

Pulled changes for repository in 'E:\AI Gen\stable-diffusion-webui-forge\extensions\stable-diffusion-webui-wd14-tagger':
Already up to date.

Launching Web UI with arguments: --ckpt-dir E:\AI Gen\stable-diffusion-webui\models\Stable-diffusion --embeddings-dir E:\AI Gen\stable-diffusion-webui\embeddings --lora-dir E:\AI Gen\stable-diffusion-webui\models\Lora --vae-dir E:\AI Gen\stable-diffusion-webui\models\VAE --esrgan-models-path E:\AI Gen\stable-diffusion-webui\models\ESRGAN --controlnet-dir E:\AI Gen\stable-diffusion-webui\models\ControlNet --controlnet-preprocessor-models-dir E:\AI Gen\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator --skip-load-model-at-start --update-all-extensions
Total VRAM 8192 MB, total RAM 16180 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 2060 SUPER : native
VAE dtype: torch.float32
2024-02-21 14:35:59.220195: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
WARNING:tensorflow:From E:\AI Gen\stable-diffusion-webui-forge\venv\lib\site-packages\keras\src\losses.py:2976: The name tf.losses.sparse_softmax_cross_entropy is deprecated. Please use tf.compat.v1.losses.sparse_softmax_cross_entropy instead.

Using pytorch cross attention
ControlNet preprocessor location: E:\AI Gen\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
[-] ADetailer initialized. version: 24.1.2, num models: 9
== WD14 tagger /gpu:0, uname_result(system='Windows', node='DESKTOP-4SOKSJ3', release='10', version='10.0.22621', machine='AMD64') ==
Loading weights [cf38a0a2ca] from E:\AI Gen\stable-diffusion-webui\models\Stable-diffusion\AstreaPixie KetorAMI-ReMIX\AstreaPixie KetoREMIX [ Improve NSFW ] V6 R1 -E5 [ Bake VAE ] .safetensors
2024-02-21 14:36:17,691 - ControlNet - INFO - ControlNet UI callback registered.
model_type EPS
UNet ADM Dimension 0
Running on local URL: http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 45.4s (prepare environment: 19.4s, import torch: 4.9s, import gradio: 1.1s, setup paths: 10.3s, initialize shared: 0.2s, other imports: 0.7s, load scripts: 7.4s, create ui: 0.9s, gradio launch: 0.5s).
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection'}
left over keys: dict_keys(['model_ema.decay', 'model_ema.num_updates'])
Loading VAE weights specified in settings: E:\AI Gen\stable-diffusion-webui\models\VAE\anythingKlF8Anime2VaeFtMse840000_blessed2.safetensors
To load target model SD1ClipModel
Begin to load 1 model
Moving model(s) has taken 0.19 seconds
Model loaded in 4.7s (load weights from disk: 0.7s, forge load real models: 3.0s, load VAE: 0.4s, calculate empty prompt: 0.4s).
[-] ADetailer: img2img inpainting detected. adetailer disabled.
2024-02-21 14:36:24,355 - ControlNet - INFO - ControlNet Input Mode: InputMode.SIMPLE
2024-02-21 14:36:24,416 - ControlNet - INFO - Using preprocessor: inpaint_only+lama
2024-02-21 14:36:24,416 - ControlNet - INFO - preprocessor resolution = 0.5
To load target model FFCResNetGenerator
Begin to load 1 model
Moving model(s) has taken 0.24 seconds
Warning torch.load doesn't support weights_only on this pytorch version, loading unsafely.
[] []
2024-02-21 14:36:28,100 - ControlNet - INFO - Current ControlNet ControlNetPatcher: E:\AI Gen\stable-diffusion-webui\models\ControlNet\control_v11p_sd15_inpaint.pth
To load target model AutoencoderKL
Begin to load 1 model
Moving model(s) has taken 0.14 seconds

CD Tuner Effective : [-2.5, 1.5, 0.5, 1.25, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 1.5]
To load target model SD1ClipModel
Begin to load 1 model
unload clone 2
Moving model(s) has taken 0.38 seconds
2024-02-21 14:36:29,654 - ControlNet - INFO - ControlNet Method inpaint_only+lama patched.
To load target model BaseModel
To load target model ControlNet
Begin to load 2 models
Moving model(s) has taken 0.81 seconds
100%|██████████████████████████████████████████████████████████████████████████████████| 25/25 [00:06<00:00, 4.09it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 25/25 [00:06<00:00, 3.89it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 25/25 [00:06<00:00, 4.29it/s]
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the IMG2IMG workflow with ControlNet-Inpainting and the “Inpaint not masked” option enabled, using the reported configuration. Compare the result with the non-ControlNet case and trace the interaction between the IMG2IMG masking behavior and ControlNet-Inpainting; done means masked content changes as expected while the combined workflow remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.