fix: sam folder not found

This commit is contained in:
Radionic
2023-09-08 17:13:49 +08:00
parent c2703dfa87
commit 8a9bca5e36
+8
View File
@@ -9,6 +9,7 @@ import os
import sys
import importlib
import subprocess
from folder_paths import add_model_folder_path
ag_path = os.path.join(os.path.dirname(__file__))
@@ -32,6 +33,13 @@ def append_to_sys_path(path):
if path not in sys.path:
sys.path.append(path)
def create_sam_model_dir():
model_dir = os.path.join(ag_path, "../../models/sam")
if not os.path.isdir(model_dir):
os.makedirs(model_dir)
add_model_folder_path('sam', model_dir)
create_sam_model_dir()
paths = ['blender', 'sam', 'common']
files = []