AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: load sdxl inpaint model wrong #16435

Open zcunyi opened 3 weeks ago

zcunyi commented 3 weeks ago

Checklist

What happened?

In txt2img interface, I added inpaint in ControlNet and select sd_xl_base_1.0_inpainting_0.1.safetensors, but an error message appeared "[ControlNet Error] Cannot recognize the ControlModel !" My checkpoint model is SDXL1.0/1.5.

Steps to reproduce the problem

  1. txt2img
  2. controlnet
  3. inpaint

What should have happened?

normal result

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

sysinfo-2024-08-28-08-37.json

Console logs

Loading weights [024c141c50] from E:\5_AI\sd-webui-aki-v4.8\models\Stable-diffusion\sdxl10ArienmixxlAsian_v45Pruned.safetensors
Applying attention optimization: xformers... done.
Weights loaded in 39.8s (send model to cpu: 2.9s, calculate hash: 33.8s, apply weights to model: 1.3s, move model to device: 1.5s).
2024-08-28 15:57:15,811 - ControlNet - INFO - unit_separate = False, style_align = False
2024-08-28 15:57:16,056 - ControlNet - INFO - Loading model: sd_xl_base_1.0_inpainting_0.1 [5679a81a]
2024-08-28 15:57:16,489 - ControlNet - INFO - Loaded state_dict from [E:\5_AI\sd-webui-aki-v4.8\models\ControlNet\sd_xl_base_1.0_inpainting_0.1.safetensors]
*** Error running process: E:\5_AI\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\controlnet.py
    Traceback (most recent call last):
      File "E:\5_AI\sd-webui-aki-v4.8\modules\scripts.py", line 832, in process
        script.process(p, *script_args)
      File "E:\5_AI\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1228, in process
        self.controlnet_hack(p)
      File "E:\5_AI\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1213, in controlnet_hack
        self.controlnet_main_entry(p)
      File "E:\5_AI\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\controlnet.py", line 919, in controlnet_main_entry
        model_net, control_model_type = Script.load_control_model(p, unet, unit.model)
      File "E:\5_AI\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\controlnet.py", line 436, in load_control_model
        control_model = Script.build_control_model(p, unet, model)
      File "E:\5_AI\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\controlnet.py", line 465, in build_control_model
        control_model = build_model_by_guess(state_dict, unet, model_path)
      File "E:\5_AI\sd-webui-aki-v4.8\extensions\sd-webui-controlnet\scripts\controlnet_model_guess.py", line 292, in build_model_by_guess
        raise Exception('[ControlNet Error] Cannot recognize the ControlModel!')
    Exception: [ControlNet Error] Cannot recognize the ControlModel!

Additional information

No response

zcunyi commented 2 weeks ago

@wangqyqq