Where are models installed by default ? #6675
-
When you run this code where is the model located how to find out the path to the model itself ? model_id = "stabilityai/stable-diffusion-2-1" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @Infinitusvoid. diffusers uses
If you'd like to change the location where your models are downloaded by default, you could do this: # If you want the variable to persist everytime you run a shell
echo "export HF_HOME=/home/profile/path/to/model/directory" >> ~/.bashrc # or config file for whatever terminal you use
# You could also create a symbolic link from your directory to HF_HUB_CACHE
ln -s /path/to/your/model/directory $HF_HUB_CACHE You could also achieve the same by using the model_id = "stabilityai/stable-diffusion-2-1"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, cache_dir="/path/to/model/directory") |
Beta Was this translation helpful? Give feedback.
Hi @Infinitusvoid.
diffusers uses
huggingface/huggingface_hub
to download and store models that you use. This provides you with a list of environment variables that hub uses by default.HF_HUB_CACHE
is what you're looking for, and by default it is~/.cache/huggingface/hub
, where~
means your home directory for your profile on windows/linux/mac.If you'd like to change the location where your models are downloaded by default, you could do this: