ComfyUI-SAM2
ComfyUI-SAM2 copied to clipboard
OSError: Failed to get source for <function Enum._generate_next_value_ at 0x000001FC03D03BA0> using inspect.getsource
I've tried with different torch versions and still getting this error:
Win11, rtx3080ti, comfy standalone
log:
got prompt Loaded checkpoint sucessfully final text_encoder_type: bert-base-uncased !!! Exception during processing !!! Failed to get source for <function Enum.generate_next_value at 0x000001FC03D03BA0> using inspect.getsource Traceback (most recent call last): File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch_jit_internal.py", line 385, in get_type_hint_captures src = inspect.getsource(fn) ^^^^^^^^^^^^^^^^^^^^^ File "inspect.py", line 1262, in getsource File "inspect.py", line 1244, in getsourcelines File "inspect.py", line 1081, in findsource OSError: could not get source code
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "D:\SD_Models\ComfyUI_windows_portable\ComfyUI\execution.py", line 316, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\ComfyUI\execution.py", line 191, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\ComfyUI\execution.py", line 168, in _map_node_over_list process_inputs(input_dict, i) File "D:\SD_Models\ComfyUI_windows_portable\ComfyUI\execution.py", line 157, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-SAM2\node.py", line 311, in main (images, masks) = sam_segment( ^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-SAM2\node.py", line 224, in sam_segment predictor = SAM2ImagePredictor(sam_model) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-SAM2\sam2\sam2_image_predictor.py", line 41, in init self._transforms = SAM2Transforms( ^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-SAM2\sam2\utils\transforms.py", line 28, in init self.transforms = torch.jit.script( ^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_script.py", line 1432, in script return _script_impl( ^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_script.py", line 1146, in _script_impl return torch.jit._recursive.create_script_module( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_recursive.py", line 556, in create_script_module concrete_type = get_module_concrete_type(nn_module, share_types) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_recursive.py", line 505, in get_module_concrete_type concrete_type = concrete_type_store.get_or_create_concrete_type(nn_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_recursive.py", line 437, in get_or_create_concrete_type concrete_type_builder = infer_concrete_type_builder(nn_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_recursive.py", line 286, in infer_concrete_type_builder sub_concrete_type = get_module_concrete_type(item, share_types) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_recursive.py", line 505, in get_module_concrete_type concrete_type = concrete_type_store.get_or_create_concrete_type(nn_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_recursive.py", line 437, in get_or_create_concrete_type concrete_type_builder = infer_concrete_type_builder(nn_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_recursive.py", line 397, in infer_concrete_type_builder attr_type, inferred = infer_type(name, value) ^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_recursive.py", line 236, in infer_type attr_type = torch._C._jit_try_infer_type(item) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit\annotations.py", line 492, in try_ann_to_type scripted_class = torch.jit._script._recursive_compile_class(ann, loc) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\jit_script.py", line 1602, in _recursive_compile_class rcb = _jit_internal.createResolutionCallbackForClassMethods(obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch_jit_internal.py", line 473, in createResolutionCallbackForClassMethods captures.update(get_type_hint_captures(fn)) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SD_Models\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch_jit_internal.py", line 387, in get_type_hint_captures raise OSError( OSError: Failed to get source for <function Enum.generate_next_value at 0x000001FC03D03BA0> using inspect.getsource