allows installing into abnormal custom node directory
https://github.com/ltdrdata/ComfyUI-Impact-Pack/issues/2#issuecomment-2191875544
This commit is contained in:
@@ -4,7 +4,7 @@ import impact.core as core
|
||||
import impact.subcore as subcore
|
||||
from impact.utils import add_folder_path_and_extensions
|
||||
|
||||
version_code = 21
|
||||
version_code = 22
|
||||
|
||||
print(f"### Loading: ComfyUI-Impact-Pack (Subpack: V0.6)")
|
||||
|
||||
|
||||
+10
-3
@@ -3,12 +3,19 @@ import sys
|
||||
from torchvision.datasets.utils import download_url
|
||||
|
||||
subpack_path = os.path.join(os.path.dirname(__file__))
|
||||
comfy_path = os.path.join(subpack_path, '..', '..', '..')
|
||||
|
||||
comfy_path = os.environ.get('COMFYUI_PATH')
|
||||
if comfy_path is None:
|
||||
print(f"\n[bold yellow]WARN: The `COMFYUI_PATH` environment variable is not set. Assuming `{os.path.dirname(__file__)}/../../../` as the ComfyUI path.[/bold yellow]", file=sys.stderr)
|
||||
comfy_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
|
||||
|
||||
sys.path.append(comfy_path)
|
||||
|
||||
import folder_paths
|
||||
model_path = folder_paths.models_dir
|
||||
model_path = os.environ.get('COMFYUI_MODEL_PATH')
|
||||
if model_path is None:
|
||||
print(f"\n[bold yellow]WARN: The `COMFYUI_MODEL_PATH` environment variable is not set. Assuming `{model_path}` as the ComfyUI path.[/bold yellow]", file=sys.stderr)
|
||||
model_path = os.path.abspath(os.path.join(comfy_path, 'models'))
|
||||
|
||||
ultralytics_bbox_path = os.path.join(model_path, "ultralytics", "bbox")
|
||||
ultralytics_segm_path = os.path.join(model_path, "ultralytics", "segm")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user