Seedsa / Fooocus_Nodes

ComfyUI Fooocus Nodes
43 stars 13 forks source link

TypeError: ModelPatcher.unpatch_model() got an unexpected keyword argument 'unpatch_weights' #2

Closed Beamhi closed 3 months ago

Beamhi commented 3 months ago

Since comfyui update today, I have been getting this error: Traceback (most recent call last):

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute

output_data, output_ui = get_output_data(obj, input_data_all)

                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data

return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)

                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list

results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\custom_nodes\Fooocus_Nodes\py\fooocusNodes.py", line 956, in image_prompt

task[0] = ip_adapter.preprocess(image, ip_adapter_path=ip_adapter_path)

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context

return func(*args, **kwargs)

       ^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context

return func(*args, **kwargs)

       ^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Fooocus\py\extras\ip_adapter.py", line 171, in preprocess

model_management.load_model_gpu(clip_vision.patcher)

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 442, in load_model_gpu

return load_models_gpu([model])

       ^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Fooocus\py\fooocus_modules\patch.py", line 441, in patched_load_models_gpu

y = comfy.model_management.load_models_gpu_origin(*args, **kwargs)

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 436, in load_models_gpu

cur_loaded_model = loaded_model.model_load(lowvram_model_memory)

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 302, in model_load

self.model_unload()

File "C:\Users\nux\Desktop\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 312, in model_unload

self.model.unpatch_model(self.model.offload_device, unpatch_weights=unpatch_weights)

TypeError: ModelPatcher.unpatch_model() got an unexpected keyword argument 'unpatch_weights'

Beamhi commented 3 months ago

The issue was probably caused by another installed node that hijacked model management. On a fresh install of comfy, I have it working again.