Mikubill / sd-webui-controlnet

WebUI extension for ControlNet
GNU General Public License v3.0
16.84k stars 1.94k forks source link

[Bug]: Preprocessing Preview Failure in ControlNet #2711

Closed thiagojramos closed 5 months ago

thiagojramos commented 5 months ago

Is there an existing issue for this?

What happened?

When attempting to use the preprocessing preview feature (e.g., canny, depth, etc.) in the ControlNet tab, by selecting the "Enable Preview" option and clicking the "run preprocessador" button, the preprocessed image does not display in the preview area. However, if I proceed with generating the image using ControlNet, the process seems to work correctly, and at the end, both the generated image and the preprocessed image are displayed together, as expected. The issue appears to be isolated to the preview stage in the extension interface.

Steps to reproduce the problem

  1. Navigate to the ControlNet tab in the WebUI interface.
  2. Insert an image to be processed.
  3. Select the "Enable Preview" option.
  4. Choose a preprocessor from the list (e.g., canny).
  5. Click on the "run preprocessador" button.
  6. Notice that the preprocessed image does not appear in the preview area.

What should have happened?

The preprocessed image should have been displayed in the preview area after selecting a preprocessor and clicking the "run preprocessador" button, allowing a preview of the preprocessing effect before the final image generation.

Commit where the problem happens

- WebUI [Dev]: https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/8bebfde7015c41efea562dd02a8f5a8bc42b44a5

- ControlNet: https://github.com/Mikubill/sd-webui-controlnet/commit/fcd542e5470241228856c2f1e85ea7b16ff087bf

What browsers do you use to access the UI ?

Microsoft Edge - Version 123.0.2420.65 (Official build) (64-bit)

Command Line Arguments

Launching Web UI with arguments: --xformers --skip-python-version-check --skip-install --update-all-extensions --disable-nan-check --xformers-flash-attention --log-startup --disable-safe-unpickle --enable-insecure-extension-access

List of enabled extensions

Captura de tela_30-3-2024_55421_127 0 0 1

Console logs

Complete log available at: https://pastebin.com/LNVcaQfX

Additional information

The preview issue occurs regardless of the preprocessor tab selected (canny, depth, etc.), and is replicable across multiple attempts following the same steps. I am using the WebUI Dev version, specifically at its latest commit, to ensure that all features are up-to-date. I am attaching a video that demonstrates the problem.

https://github.com/Mikubill/sd-webui-controlnet/assets/45890502/40115f35-4f5c-4c5e-ba0e-853f99f448e0

huchenlei commented 5 months ago

I think this is the only relevant error:

*** Error running process: C:\AI\Packages\WebUI\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "C:\AI\Packages\WebUI\modules\scripts.py", line 820, in process
        script.process(p, *script_args)
      File "C:\AI\Packages\WebUI\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1277, in process
        self.controlnet_hack(p)
      File "C:\AI\Packages\WebUI\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1262, in controlnet_hack
        self.controlnet_main_entry(p)
      File "C:\AI\Packages\WebUI\extensions\sd-webui-controlnet\scripts\controlnet.py", line 882, in controlnet_main_entry
        self.enabled_units = Script.get_enabled_units(p)
      File "C:\AI\Packages\WebUI\extensions\sd-webui-controlnet\scripts\controlnet.py", line 569, in get_enabled_units
        local_unit.module = IPAdapterPreset.match_model(local_unit.model).module
      File "C:\AI\Packages\WebUI\extensions\sd-webui-controlnet\scripts\ipadapter\presets.py", line 19, in match_model
        return _preset_by_model[model_name]
    KeyError: 'ip-adapter-faceid-portrait-v11_sd15'

Will fix soon.