Add files via upload

This commit is contained in:
AIExplorer
2025-03-25 16:55:36 +05:30
committed by GitHub
parent 8fa9c3ff71
commit efa381365a
3 changed files with 41 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
+36
View File
@@ -0,0 +1,36 @@
import os
from huggingface_hub import hf_hub_download
import hf_transfer
class AutoDownloadModels:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"repo_id": ("STRING", {"tooltip": "Enter hugging face repo id"}),
"model_name": ("STRING", {"tooltip": "Enter hugging face model name to download"}),
"path_to_download": ("STRING", {"tooltip": "Enter to download the model to"}),
},
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("path",)
FUNCTION = "DownloadModel"
CATEGORY = "DownloadModel"
DESCRIPTION = "This node downloads models from huggingface models"
def DownloadModel(self, repo_id, model_name, path_to_download):
model_path = hf_hub_download(repo_id=repo_id, filename=model_name, local_dir=path_to_download)
return model_path
NODE_CLASS_MAPPINGS = {
"AutoDownloadModels": AutoDownloadModels,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"AutoDownloadModels": "Auto Download Models",
}
+2
View File
@@ -0,0 +1,2 @@
huggingface_hub[hf_transfer]
hf_transfer