Files
daxcay-ComfyUI-JDCN/JDCN_AnyFileSelector.py
T
daxcay b5d49a1ebb Category Name Change and Making New REPO for Research tool
Decision was due to the increase of loading size of JDCN users who were not Using Reasearch nodes
2024-04-26 18:06:02 +05:30

59 lines
1.2 KiB
Python

import os
import numpy as np
class AlwaysEqualProxy(str):
def __eq__(self, _):
return True
def __ne__(self, _):
return False
class JDCN_AnyFileSelector:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"PathList": ("STRING", {"forceInput": True}),
"Index": ("INT", {"default": 1, "min": 1, "max": 9999}),
"Change": (['fixed', 'increment', 'decrement'],)
},
}
INPUT_IS_LIST = True
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("out",)
OUTPUT_NODE = True
FUNCTION = "make_list"
CATEGORY = "🔵 JDCN 🔵"
def make_list(self, PathList, Index, Change):
Index = Index[0] - 1
if len(PathList) == 0:
print("Error in List Variable")
return None
if Index < 0 or Index >= len(PathList):
print("Error in List Variable")
return None
return (PathList[Index],)
N_CLASS_MAPPINGS = {
"JDCN_AnyFileSelector": JDCN_AnyFileSelector,
}
N_DISPLAY_NAME_MAPPINGS = {
"JDCN_AnyFileSelector": "JDCN_AnyFileSelector",
}