How do I change the cache default folder for "hub"?

I use multiple AI models and tools, and multiple ones keep downloading models inside: C:\Users\name.cache\huggingface\hub
I don’t have much space left there.
How can I change it?
A research led me to: “Change model download folder?” and to: “Environment variables

My question is: HOW DO I MODIFY THE HF HOME?
(I am using UI tools that run multiple AI techs in “the background” sorta")
do I have to search in all scripts for the area where HF HOME is located?
Isnt there some easier way to know where is it every time please?

If you change the HF_HOME environment variable, all programs will use the modified cache folder on their own.
This is the easiest way.
However, it does not mean that the cache that has been downloaded so far will be moved or disappear by itself, so you will have to do something about that.

The problem Is I am using lot of tools that have this HF_HOME pre written in them, Iwill have to do a research to find them each time:

  1. Blender, with an extension called “dream”
  2. comfyUI with lot of extensions

For blender, we have this:

Where is “HF_HOME”? I can’t see it???

For comfyui, we have:
https://github.com/MrForExample/Comfy**UI-3D-Pack**
Where is “HF_HOME”? I don’t see it…
And I know this extension alone was responsible for 3 folders on my huggingface .cache directory:
image

If you set one environment variable, the programs will refer to it on their own, so you don’t have to worry about it.
However, some programs ignore environment variables, so if that happens, you will have to modify the program yourself.
I’m sure ComfyUI components and such will reference them properly…
Setting environment variables in the Windows environment is a bit confusing, so see below.
https://www.digitalcitizen.life/simple-questions-what-are-environment-variables/

1 Like

Something like this?
image

1 Like

I confirm it seems to be working (for blender addon that use HG at least). Blender still keep installing the addon data in C: though but that’s a different problem.
Edit: Blender solution: Command Line Arguments - Blender 4.2 Manual

1 Like

Well, Blender is not an HF-related application. But I’m glad you were able to resolve it.
If you manually move your old cache, it will work as a cache. It’s better to download it again, though.

1 Like