55from comfy .comfy_types import IO
66from comfy_api .input_impl import VideoFromFile
77
8+ from pathlib import Path
9+
810
911def normalize_path (path ):
1012 return path .replace ('\\ ' , '/' )
@@ -16,7 +18,14 @@ def INPUT_TYPES(s):
1618
1719 os .makedirs (input_dir , exist_ok = True )
1820
19- files = [normalize_path (os .path .join ("3d" , f )) for f in os .listdir (input_dir ) if f .endswith (('.gltf' , '.glb' , '.obj' , '.fbx' , '.stl' ))]
21+ input_path = Path (input_dir )
22+ base_path = Path (folder_paths .get_input_directory ())
23+
24+ files = [
25+ normalize_path (str (file_path .relative_to (base_path )))
26+ for file_path in input_path .rglob ("*" )
27+ if file_path .suffix .lower () in {'.gltf' , '.glb' , '.obj' , '.fbx' , '.stl' }
28+ ]
2029
2130 return {"required" : {
2231 "model_file" : (sorted (files ), {"file_upload" : True }),
@@ -61,7 +70,14 @@ def INPUT_TYPES(s):
6170
6271 os .makedirs (input_dir , exist_ok = True )
6372
64- files = [normalize_path (os .path .join ("3d" , f )) for f in os .listdir (input_dir ) if f .endswith (('.gltf' , '.glb' , '.fbx' ))]
73+ input_path = Path (input_dir )
74+ base_path = Path (folder_paths .get_input_directory ())
75+
76+ files = [
77+ normalize_path (str (file_path .relative_to (base_path )))
78+ for file_path in input_path .rglob ("*" )
79+ if file_path .suffix .lower () in {'.gltf' , '.glb' , '.fbx' }
80+ ]
6581
6682 return {"required" : {
6783 "model_file" : (sorted (files ), {"file_upload" : True }),
0 commit comments