tencent-ailab / IP-Adapter

The image prompt adapter is designed to enable a pretrained text-to-image diffusion model to generate images with image prompt.
Apache License 2.0
5.18k stars 335 forks source link

stable diffusion error : cannot import name 'load_file_from_url' from 'modules.modelloader' #118

Open mostafablender opened 12 months ago

mostafablender commented 12 months ago

hi i get this error in stable diffusion

100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:23<00:00, 1.19s/it] Total progress: 100%|██████████████████████████████████████████████████████████████████| 20/20 [00:24<00:00, 1.20s/it] 2023-10-29 06:03:13,516 - ControlNet - INFO - Loading model from cache: ip-adapter_sd15 [6a3f6166]:24<00:00, 1.17s/it] 2023-10-29 06:03:13,517 - ControlNet - INFO - Loading preprocessor: ip-adapter_clip_sd15 2023-10-29 06:03:13,518 - ControlNet - INFO - preprocessor resolution = 512 Error running process: D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlnet.py Traceback (most recent call last): File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\modules\scripts.py", line 417, in process script.process(p, script_args) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlnet.py", line 977, in process self.controlnet_hack(p) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlnet.py", line 966, in controlnet_hack self.controlnet_main_entry(p) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlnet.py", line 808, in controlnet_main_entry detected_map, is_image = preprocessor( File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\utils.py", line 75, in decorated_func return cached_func(args, kwargs) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\utils.py", line 63, in cached_func return func(*args, *kwargs) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\global_state.py", line 35, in unified_preprocessor return preprocessor_modules[preprocessor_name](args, kwargs) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\processor.py", line 350, in clip from annotator.clipvision import ClipVisionDetector File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\annotator\clipvision__init__.py", line 5, in from modules.modelloader import load_file_from_url ImportError: cannot import name 'load_file_from_url' from 'modules.modelloader' (D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\modules\modelloader.py)

xiaohu2015 commented 12 months ago

@mostafablender I think you should update to the latest version of sd-webui-controlnet

vootox commented 12 months ago

Maybe my issue is a coincidence. I'm using comfyui and no longer can import any model into IPAdapter loader. It was OK a day or so ago when I last ran using the node.

mostafablender commented 12 months ago

i do click on update on stable diffusion and it search for updating but if this is the problem . it wont update it itself . i think when i added the adapter models it did not download the main model for it i mean when i want use other controlnet like normal and depth and open pose . usually i had to download some models then when i press one of them to make image first sd download some models itself for somewhere else . i think i dont have that model yet . can you write me exactly where "load_file_from_url " pass is bc i cant find it (not a good dev ) and tell me one more time what exactly i have to downlod for this model to work ? i see 4 links for downloading behind the models i have to download all of those models ?

mostafablender commented 12 months ago

i think my error is about stable diffusion automatic1111 cant download preprocessor " ip_adapter_clip_sd15" and i dont know how to fix it

mostafablender commented 12 months ago

still could not fix it . my entire error is this : Error running process: D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlnet.py Traceback (most recent call last): File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\modules\scripts.py", line 417, in process script.process(p, script_args) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlnet.py", line 977, in process self.controlnet_hack(p) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlnet.py", line 966, in controlnet_hack self.controlnet_main_entry(p) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlnet.py", line 944, in controlnet_main_entry param.control_model.hook( File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(args, *kwargs) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlmodel_ipadapter.py", line 327, in hook self.image_emb, self.uncond_image_emb = self.ipadapter.get_image_embeds(clip_vision_output) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(args, **kwargs) File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\scripts\controlmodel_ipadapter.py", line 203, in get_image_embeds from annotator.clipvision import clip_vision_h_uc File "D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\extensions\sd-webui-controlnet\annotator\clipvision__init__.py", line 5, in from modules.modelloader import load_file_from_url ImportError: cannot import name 'load_file_from_url' from 'modules.modelloader' (D:\Games\SSSSSSSSSSS\stable-diffusion-webui-master\modules\modelloader.py)

xiaohu2015 commented 12 months ago

@mostafablender can you find load_file_from_url from https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/modules/modelloader.py