fix checkmodelpath function
This commit is contained in:
+3
-2
@@ -98,6 +98,7 @@ def check_and_download_model(model_path, repo_id):
|
||||
print(f"Downloading {repo_id} model...")
|
||||
from huggingface_hub import snapshot_download
|
||||
snapshot_download(repo_id=repo_id, local_dir=model_path, ignore_patterns=["*.md", "*.txt", "onnx", ".git"])
|
||||
return model_path
|
||||
|
||||
'''Converter'''
|
||||
|
||||
@@ -1527,9 +1528,9 @@ class VITMatteModel:
|
||||
|
||||
def load_VITMatte_model(model_name:str, local_files_only:bool=False) -> object:
|
||||
model_name = "vitmatte"
|
||||
model_path = os.path.join(folder_paths.models_dir, model_name)
|
||||
model_repo = "hustvl/vitmatte-small-composition-1k"
|
||||
check_and_download_model(model_name, model_repo)
|
||||
model_path = check_and_download_model(model_name, model_repo)
|
||||
|
||||
from transformers import VitMatteImageProcessor, VitMatteForImageMatting
|
||||
model = VitMatteForImageMatting.from_pretrained(model_path, local_files_only=local_files_only)
|
||||
processor = VitMatteImageProcessor.from_pretrained(model_path, local_files_only=local_files_only)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui_layerstyle"
|
||||
description = "A set of nodes for ComfyUI it generate image like Adobe Photoshop's Layer Style. the Drop Shadow is first completed node, and follow-up work is in progress."
|
||||
version = "2.0.4"
|
||||
version = "2.0.5"
|
||||
license = "MIT"
|
||||
dependencies = ["numpy", "pillow", "torch", "matplotlib", "Scipy", "scikit_image", "scikit_learn", "opencv-contrib-python", "pymatting", "timm", "colour-science", "transformers", "blend_modes", "huggingface_hub", "loguru"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user