error IP-Adapter

#39
by Linami - opened

IP-Adapter gives an error when working. Please help me figure it out.
I don't know what to do. I installed the models, renamed bin to pth, chose the preprocessor ip-adapter_clip_h and model ip-adapter-plus_sd15. It throws an error every time. There are no problems with ControlNet in other cases (Canny, Depth...)
What could be the problem?

*** Error running process: C:\Users\rogov\stable-diffusion-webui\extensions\sd-dynamic-prompts\scripts\dynamic_prompting.py
Traceback (most recent call last):
File "C:\Users\rogov\stable-diffusion-webui\modules\scripts.py", line 825, in process
script.process(p, *script_args)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-dynamic-prompts\sd_dynamic_prompts\dynamic_prompting.py", line 480, in process
all_prompts, all_negative_prompts = generate_prompts(
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-dynamic-prompts\sd_dynamic_prompts\helpers.py", line 93, in generate_prompts
all_prompts = prompt_generator.generate(prompt, num_prompts, seeds=seeds) or [""]
File "C:\Users\rogov\stable-diffusion-webui\venv\lib\site-packages\dynamicprompts\generators\randomprompt.py", line 71, in generate
prompts.append(str(next(iter(gen))))
StopIteration


2024-05-11 14:06:13,859 - ControlNet - INFO - unit_separate = False, style_align = False
2024-05-11 14:06:14,016 - ControlNet - INFO - Loading model: ip-adapter-plus_sd15 [c817b455]
2024-05-11 14:06:14,061 - ControlNet - INFO - Loaded state_dict from [C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\models\ip-adapter-plus_sd15.pth]
2024-05-11 14:06:14,297 - ControlNet - INFO - ControlNet model ip-adapter-plus_sd15 c817b455 loaded.
2024-05-11 14:06:14,352 - ControlNet - INFO - Using preprocessor: ip-adapter_clip_h
2024-05-11 14:06:14,352 - ControlNet - INFO - preprocessor resolution = 512
*** Error verifying pickled file from C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads\clip_vision\clip_h.pth
*** -----> !!!! The file is most likely corrupted !!!! <-----
*** You can skip this check with --disable-safe-unpickle commandline argument, but that is not going to help you.


Traceback (most recent call last):
  File "C:\Users\rogov\stable-diffusion-webui\modules\safe.py", line 83, in check_pt
    with zipfile.ZipFile(filename) as z:
  File "C:\Users\rogov\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1267, in __init__
    self._RealGetContents()
  File "C:\Users\rogov\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1334, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\rogov\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1245, in load_persid
    pid = self.readline()[:-1].decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 63: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\rogov\stable-diffusion-webui\modules\safe.py", line 137, in load_with_extra
    check_pt(filename, extra_handler)
  File "C:\Users\rogov\stable-diffusion-webui\modules\safe.py", line 104, in check_pt
    unpickler.load()
  File "C:\Users\rogov\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1213, in load
    dispatch[key[0]](self)
  File "C:\Users\rogov\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1247, in load_persid
    raise UnpicklingError(
_pickle.UnpicklingError: persistent IDs in protocol 0 must be ASCII strings

*** Error running process: C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py
Traceback (most recent call last):
File "C:\Users\rogov\stable-diffusion-webui\modules\scripts.py", line 825, in process
script.process(p, script_args)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1215, in process
self.controlnet_hack(p)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 1200, in controlnet_hack
self.controlnet_main_entry(p)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 934, in controlnet_main_entry
controls, hr_controls, additional_maps = get_control(
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 290, in get_control
controls, hr_controls = list(zip(
[preprocess_input_image(img) for img in optional_tqdm(input_images)]))
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 290, in
controls, hr_controls = list(zip(*[preprocess_input_image(img) for img in optional_tqdm(input_images)]))
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 242, in preprocess_input_image
result = preprocessor.cached_call(
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\supported_preprocessor.py", line 206, in cached_call
result = self._cached_call(input_image, *args, **kwargs)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 82, in decorated_func
return cached_func(*args, **kwargs)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\utils.py", line 66, in cached_func
return func(*args, **kwargs)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\supported_preprocessor.py", line 219, in cached_call
return self(*args, **kwargs)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\legacy_preprocessors.py", line 105, in call
result, is_image = self.call_function(
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\preprocessor\legacy\processor.py", line 375, in clip
clip_encoder[config] = ClipVisionDetector(config, low_vram)
File "C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\clipvision_init
.py", line 122, in init
self.model.load_state_dict(sd, strict=False)
File "C:\Users\rogov\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1994, in load_state_dict
raise TypeError("Expected state_dict to be dict-like, got {}.".format(type(state_dict)))
TypeError: Expected state_dict to be dict-like, got <class 'NoneType'>.

I've got the same error. You need to check the clip_h.pth file size:
C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads\clip_vision\clip_h.pth
It should be 2.35Gb.
In my case it was downloaded partially and I've got the same error. I've spent half a day to find out what was wrong.
I have deleted the file and run the IP-Adapter again to force downloading the full file again. But you can also find the full file and replace the corrupted one with the normal one.

I've got the same error. You need to check the clip_h.pth file size:
C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads\clip_vision\clip_h.pth
It should be 2.35Gb.
In my case it was downloaded partially and I've got the same error. I've spent half a day to find out what was wrong.
I have deleted the file and run the IP-Adapter again to force downloading the full file again. But you can also find the full file and replace the corrupted one with the normal one.

Thanks for the advice! I couldn't figure it out on my own. I will definitely check it out)

I've got the same error. You need to check the clip_h.pth file size:
C:\Users\rogov\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads\clip_vision\clip_h.pth
It should be 2.35Gb.
In my case it was downloaded partially and I've got the same error. I've spent half a day to find out what was wrong.
I have deleted the file and run the IP-Adapter again to force downloading the full file again. But you can also find the full file and replace the corrupted one with the normal one.

It's working. Thanks!

Sign up or log in to comment