AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
137.3k stars 26.14k forks source link

[Feature Request]: Set a default clip_models_path #16093

Open allo- opened 1 month ago

allo- commented 1 month ago

Is there an existing issue for this?

What would your feature do ?

The interrogate module is currently loading clip from a given command line parameter

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/feee37d75f1b168768014e4634dcb156ee649c05/modules/interrogate.py#L112

and if the parameter is omitted, clip falls back to using .cache/clip which is outside the usual directories, i.e. models/CLIP inside the webui directory and possibly the huggingface cache directory.

I discovered this when I tried to sandbox the webui and it kept downloading the clip model. Having clearly defined folders like the models folder makes it easier to know where the required files are and where you need to allow access or not.

Steps to reproduce

  1. Go to img2img
  2. press the interrogate CLIP button
  3. BLIP is downloaded to models/BLIP
  4. CLIP is downloaded to .cache/clip, which is hard to find out, as clip.load and not the webui code contains the default download location.

Proposed solution

Set the default download path to models/CLIP.

w-e-w commented 1 month ago

I believe the intentions of the clip developers for putting their models under ~.cache/clip is so that the clip modules can be shared across multiple software without re-downloading