stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[CLIP interrogator] use local file, if available
fixes issue mentioned in AUTOMATIC1111/stable-diffusion-webui-feature-showcase#8
Downloading BLIP...
Error interrogating
Traceback (most recent call last):
File "D:\AI\SuperSD20\stable-diffusion-webui\modules\interrogate.py", line 175, in interrogate
self.load()
File "D:\AI\SuperSD20\stable-diffusion-webui\modules\interrogate.py", line 104, in load
self.blip_model = self.load_blip_model()
File "D:\AI\SuperSD20\stable-diffusion-webui\modules\interrogate.py", line 81, in load_blip_model
open(blip_model_local, 'wb').write(req.get(blip_model_url, allow_redirects=True).content)
FileNotFoundError: [Errno 2] No such file or directory: 'models\\Interrogator\\BLIP_model.pth'
Also, I think you should name it models\BLIP\model_base_caption_capfilt_large.pth to be more consistent with how other model files are named.
@CarlKenner Thank you for the heads-up. Forgot to check if the user has the directory. Should work now, but can you please confirm?
i can't reproduce; blip_decoder already does this; no download is happening for me
i can't reproduce; blip_decoder already does this; no download is happening for me
Blip decoder keeps downloading every time you relaunch the app. Maybe you are retrying on the same session.
Unless there is an extra code I am missing, the following [former] code also implies that:
blip_model = models.blip.blip_decoder(pretrained=blip_model_url, image_size=blip_image_eval_size, vit='base', med_config=os.path.join(paths.paths["BLIP"], "configs", "med_config.json"))
That is the reason for this pull request.

I start the program from scratch, put a breakpoint, do interrogate, and this is where I end up; the file exists, nothing is downloaded.
AUTOMATIC1111, this became an unintended bug report. I am lost on what is happening, but that behaviour happens to me, and to @kevinhower that created https://github.com/AUTOMATIC1111/stable-diffusion-webui-feature-showcase/issues/8. If it helps, I have two computers with different webui-user.bat configs.
One has: --lowvram --precision full --no-half --no-half-vae --always-batch-cond-uncond --xformers --autolaunch The other: --medvram --xformers --autolaunch --offline
Note the --offline flag is from my other PR but it only affects the git pulls and installs in initialization.
Thank you for this contribution and merge! I was also seeing the download repeat needlessly whenever I used the CLIP interrogator, despite it clearly having completed its download before, and I couldn't figure out what was going on. I pulled and tried again after this PR merged, and it didn't repeat the model download. Huzzah! :heart: :rocket: