Skip to content

Commit

Permalink
Merge pull request AUTOMATIC1111#897 from Mikubill/lvmin
Browse files Browse the repository at this point in the history
add sanity check to log so that reading github issue is easier
  • Loading branch information
lllyasviel authored Apr 18, 2023
2 parents 20a5310 + d62badd commit c98dca5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions annotator/annotator_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@
if not models_path:
models_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'downloads')

clip_vision_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'clip_vision')
# clip vision is always inside controlnet "extensions\sd-webui-controlnet"
# and any problem can be solved by removing controlnet and reinstall

models_path = os.path.realpath(models_path)
os.makedirs(models_path, exist_ok=True)
print(f'ControlNet preprocessor location: {models_path}')
# Make sure that the default location is inside controlnet "extensions\sd-webui-controlnet"
# so that any problem can be solved by removing controlnet and reinstall
# if users do not change configs on their own (otherwise users will know what is wrong)
6 changes: 4 additions & 2 deletions annotator/clip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from transformers import CLIPProcessor, CLIPVisionModel
from modules import devices
import os
from annotator.annotator_path import models_path
from annotator.annotator_path import clip_vision_path


remote_model_path = "https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/pytorch_model.bin"
clip_path = os.path.join(os.path.dirname(models_path), 'clip_vision')
clip_path = clip_vision_path
print(f'ControlNet ClipVision location: {clip_path}')

clip_proc = None
clip_vision_model = None

Expand Down

0 comments on commit c98dca5

Please sign in to comment.