refactor(interrogate): use configurable clip_models_path

- Remove unused paths import from deepbooru.py and openclip.py
- Use shared.opts.clip_models_path instead of hardcoded paths
This commit is contained in:
CalamitousFelicitousness
2026-01-25 00:50:17 +00:00
parent ec7934799e
commit ef797169a3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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(