diff --git a/modules/interrogate/deepbooru.py b/modules/interrogate/deepbooru.py index f32c590a9..1e18cc2ce 100644 --- a/modules/interrogate/deepbooru.py +++ b/modules/interrogate/deepbooru.py @@ -4,7 +4,7 @@ import threading import torch import numpy as np from PIL import Image -from modules import modelloader, paths, devices, shared +from modules import modelloader, devices, shared re_special = re.compile(r'([\\()])') load_lock = threading.Lock() @@ -18,7 +18,7 @@ class DeepDanbooru: with load_lock: if self.model is not None: return - model_path = os.path.join(paths.models_path, "DeepDanbooru") + model_path = os.path.join(shared.opts.clip_models_path, "DeepDanbooru") shared.log.debug(f'Interrogate load: module=DeepDanbooru folder="{model_path}"') files = modelloader.load_models( model_path=model_path, diff --git a/modules/interrogate/openclip.py b/modules/interrogate/openclip.py index ca69ad8dd..359b97b4b 100644 --- a/modules/interrogate/openclip.py +++ b/modules/interrogate/openclip.py @@ -5,7 +5,7 @@ import threading import re import gradio as gr from PIL import Image -from modules import devices, paths, shared, errors, sd_models +from modules import devices, shared, errors, sd_models debug_enabled = os.environ.get('SD_INTERROGATE_DEBUG', None) is not None @@ -99,7 +99,7 @@ def load_interrogator(clip_model, blip_model): if ci is None: t0 = time.time() device = devices.get_optimal_device() - cache_path = os.path.join(paths.models_path, 'Interrogator') + cache_path = shared.opts.clip_models_path shared.log.info(f'CLIP load: clip="{clip_model}" blip="{blip_model}" device={device}') debug_log(f'CLIP load: cache_path="{cache_path}" max_length={shared.opts.interrogate_clip_max_length} chunk_size={shared.opts.interrogate_clip_chunk_size} flavor_count={shared.opts.interrogate_clip_flavor_count} offload={shared.opts.interrogate_offload}') interrogator_config = clip_interrogator.Config(