Jannchie / ComfyUI-J

Jannchie's ComfyUI custom nodes.
64 stars 13 forks source link

can it be offline #6

Closed zmwv823 closed 3 months ago

zmwv823 commented 3 months ago

1、('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

2、With local_files_only set to False, you must first locally save the tokenizer in the following path: 'openai/clip-vit-large-patch14'.

Jannchie commented 3 months ago

That's a real problem. I should specify a cache directory where you can download the model and put it.

NeedsMoar commented 3 months ago

By default it'll first use the completely %XDG_CACHE_HOME%\huggingface directory on Windows, then fallback to %DIFFUSERS_CACHE% directory on Windows, and I think failing that %HOME%.cache

XDG_CACHE_HOME usually won't be set on Windows, it's part of some attempt to standardize various file locations on Linuxes... the problem is they then forged ahead and decided to define defaults for Windows without reading a single word of the page on Microsoft's site telling you things like "Don't dump random crap in the user's base home directory because only things considered libraries with shell extensions belong there" or fire up a Windows VM for 5 minutes to learn exciting facts like "Putting a period before a directory name has zero meaning on any version of Windows ever, because we have a file attribute dating back to FAT12 to flag hidden files".

What we do have is %LOCALAPPDATA% which is the designated location to store the things that variable was made for, is a hidden directory so behaves like they're wanting and doesn't crap up the top level user directory with a bunch of period-prefixed subdirectories that float above the Pictures / Documents / Video libraries and everything else that might be there in the sort order, but hey, why spend 15 seconds finding that on google? Lots of stuff just ignores the XDG environment variables and hardcodes it on Windows anyway, but diffusers can at least be redirected with it so either having people specify that or having them put it in %HOME%/.cache/huggingface should be workarounds, kinda, but it obnoxiously uses long hashed filenames with no extensions for the actual data files and a bunch of symlinks to access them if git LFS is enabled, which it is by default in the installer. It also doesn't delete old file versions when they're updated on huggingface, so for frequently changing repos with large models you'll end up with a disk-space waste explosion pretty quickly.

Jannchie commented 3 months ago

@NeedsMoar Thanks for pointing this out.

I noticed that the models/diffusers directory exists in comfyUI's workspace, so maybe I should set the cache path there.

BloodLaad commented 3 months ago

I'm running into the same issue on Linux. If I install clip-vit-large-patch14 using ComfyUI-Manager it is saved under <your_models_path>/clip_vision/clip-vit-large-patch14.bin. Is there any way to fix this on my side? Placing the model under ~/.cache/huggingface/hub/openai/clip-vit-large-patch14, ~/.cache/huggingface/openai/clip-vit-large-patch14or even ~/.cache/openai/clip-vit-large-patch14 did not work. (The ComfyUI and models folder also don't work)

zmwv823 commented 3 months ago

It can be totally run on local machine for me now. Modified diffusers single_file_utils.py and single_file.py, and set up a nodejs server for yaml file download. Also this nodejs server works for TripoSR model viewer.