biegert/ComfyUI-CLIPSeg

Exception during processing!!! HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /CIDAS/clipseg-rd64-refined/resolve/main/model.safetensors

Opened this issue · 11 comments

Exception during processing!!! HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /CIDAS/clipseg-rd64-refined/resolve/main/model.safetensors (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001F558555CC0>, 'Connection to huggingface.co timed out. (connect timeout=10)'))

same

I met same. I have to dowload the /CIDAS/clipseg-rd64-refined document from Huggingface.co manually. But I don't know where place can I put them in ? It looks that .cache\huggingface\hub\models--CIDAS--clipseg-rd64-refined\snapshots\583b388deb98a04feb3e1f816dcdb8f3062ee205 isn't the right place. So can you tell me the place please?

YDBZ commented

I update comfyui and python then this error occured >> Exception during processing!!! HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /CIDAS/clipseg-rd64-refined/resolve/main/model.safetensors (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001F558555CC0>, 'Connection to huggingface.co timed out. (connect timeout=10)')) --- what is right place for clipseg model?!

YDBZ commented

my older comfyui worked but after updating clip seg not work
clip seg in new comfyui just worked when i am connecting to internet

YDBZ commented

Exception during processing!!! HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /CIDAS/clipseg-rd64-refined/resolve/main/model.safetensors (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001F558555CC0>, 'Connection to huggingface.co timed out. (connect timeout=10)'))

shadowcz007/comfyui-mixlab-nodes#36 (comment)

YDBZ commented

I met same. I have to dowload the /CIDAS/clipseg-rd64-refined document from Huggingface.co manually. But I don't know where place can I put them in ? It looks that .cache\huggingface\hub\models--CIDAS--clipseg-rd64-refined\snapshots\583b388deb98a04feb3e1f816dcdb8f3062ee205 isn't the right place. So can you tell me the place please?

shadowcz007/comfyui-mixlab-nodes#36 (comment)

looks like clipseg is checking online for the clipseg model. but without this check it produces an error and refuses to work. i had clipseg installed and the model loaded properly to .cache. if i call a clipseg process my firewall tells me python wants a connection. if that is blocked clipseg dont run and produces an error. if i allow that connection then clipseg runs without an error and without downloading the model because it is already there.

at this state clipseg is online forcing for working. no offline usability.

edit: found a way to prevent this and get "base"clipseg to work offline. if interested let me know.

looks like clipseg is checking online for the clipseg model. but without this check it produces an error and refuses to work. i had clipseg installed and the model loaded properly to .cache. if i call a clipseg process my firewall tells me python wants a connection. if that is blocked clipseg dont run and produces an error. if i allow that connection then clipseg runs without an error and without downloading the model because it is already there.

at this state clipseg is online forcing for working. no offline usability.

edit: found a way to prevent this and get "base"clipseg to work offline. if interested let me know.

I am getting the same issue. How did you get it to work offline, I don't want to mess around with Firewall settings... Thanks.

i edited the clipseg.py it should be in your custom_nodes folder. inside there you should find this

    processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
    model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")

this loads the model from the .cache in windows. and if the files are there it worked but also produces some online query or requesting a config file every time ...i dont know. but if you change "CIDAS/clipseg-rd64-refined" to a other file path then clipseg is using the files from that path and dont goes to internet. you can chose the original cache files. but you have to chose the folder where the pytorch_model.bin is in. and because this folder is not in comfy you have to take a full path to there. like "C:\Users\User01.cache\huggingface\hub\models--CIDAS--clipseg-rd64-refined\snapshots\583b388deb98a04feb3e1f816dcdb8f3062ee205" in my case.

i take little other way. as i also had installed KJnodes. but KJnodes using a diffrent model set of clipseg and it´s own node to use it. with less/other options. it uses a fp16 model of clipseg and a comfy model path ....ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16

but clipseg.py can work with that model. and if clipseg works then the impact pack clipseg also works. so i point clipseg.py to that KJnodes clipseg model location.

processor = CLIPSegProcessor.from_pretrained("ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16")
    model = CLIPSegForImageSegmentation.from_pretrained("ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16")

with that clipseg is working with that fp16 model from KJnodes and dont getting online anymore. and nodes with using clipseg like impact pack are also working. you also can use any other model of clipseg. you only need to point at the folder where the pytorch_model.bin and the json´s are inside.

i edited the clipseg.py it should be in your custom_nodes folder. inside there you should find this

    processor = CLIPSegProcessor.from_pretrained("CIDAS/clipseg-rd64-refined")
    model = CLIPSegForImageSegmentation.from_pretrained("CIDAS/clipseg-rd64-refined")

this loads the model from the .cache in windows. and if the files are there it worked but also produces some online query or requesting a config file every time ...i dont know. but if you change "CIDAS/clipseg-rd64-refined" to a other file path then clipseg is using the files from that path and dont goes to internet. you can chose the original cache files. but you have to chose the folder where the pytorch_model.bin is in. and because this folder is not in comfy you have to take a full path to there. like "C:\Users\User01.cache\huggingface\hub\models--CIDAS--clipseg-rd64-refined\snapshots\583b388deb98a04feb3e1f816dcdb8f3062ee205" in my case.

i take little other way. as i also had installed KJnodes. but KJnodes using a diffrent model set of clipseg and it´s own node to use it. with less/other options. it uses a fp16 model of clipseg and a comfy model path ....ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16

but clipseg.py can work with that model. and if clipseg works then the impact pack clipseg also works. so i point clipseg.py to that KJnodes clipseg model location.

processor = CLIPSegProcessor.from_pretrained("ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16")
    model = CLIPSegForImageSegmentation.from_pretrained("ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16")

with that clipseg is working with that fp16 model from KJnodes and dont getting online anymore. and nodes with using clipseg like impact pack are also working. you also can use any other model of clipseg. you only need to point at the folder where the pytorch_model.bin and the json´s are inside.

Thanks for the detailed response, much appreciated. I spent 3 hours trying to figure it out on my own without any luck. Interestingly I got some other errors when pointing it to the .cache location (C:\Users\MyUser.cache\huggingface\hub\models--CIDAS--clipseg-rd64-refined\snapshots\583b388deb98a04feb3e1f816dcdb8f3062ee205). It seems that the pytorch_model.bin was not compatible. So I tried the clipseg-rd64-refined-fp16 model you mentioned https://huggingface.co/Kijai/clipseg-rd64-refined-fp16. I simply cloned the repo it into ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16. Then updated clipseg.py:

    processor = CLIPSegProcessor.from_pretrained("ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16")
    model = CLIPSegForImageSegmentation.from_pretrained("ComfyUI\models\clip_seg\clipseg-rd64-refined-fp16")

Thanks again for your help!