diff --git a/README.md b/README.md index 9d581d6..dcd177f 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,16 @@ To use the API: start WebUI with argument `--api` and go to `http://webui-addres To use external call: Checkout [Wiki](https://github.com/Mikubill/sd-webui-controlnet/wiki/API) +### Command Line Arguments + +This extension adds these command line arguments to the webui: + +``` + --controlnet-dir ADD a controlnet models directory + --controlnet-annotator-models-path SET the directory for annotator models + --no-half-controlnet load controlnet models in full precision +``` + ### MacOS Support Tested with pytorch nightly: https://github.com/Mikubill/sd-webui-controlnet/pull/143#issuecomment-1435058285 diff --git a/annotator/annotator_path.py b/annotator/annotator_path.py index 279c193..ba168e1 100644 --- a/annotator/annotator_path.py +++ b/annotator/annotator_path.py @@ -7,6 +7,9 @@ if not models_path: if not models_path: models_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'downloads') +if not os.path.isabs(models_path): + models_path = os.path.join(shared.data_path, models_path) + 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 diff --git a/scripts/controlnet.py b/scripts/controlnet.py index 2798996..0661961 100644 --- a/scripts/controlnet.py +++ b/scripts/controlnet.py @@ -12,9 +12,9 @@ import gradio as gr import numpy as np from einops import rearrange -import annotator +from annotator import annotator_path from scripts import global_state, hook, external_code, processor -importlib.reload(annotator) +importlib.reload(annotator_path) importlib.reload(processor) importlib.reload(global_state) importlib.reload(hook)