Gourieff / comfyui-reactor-node

Fast and Simple Face Swap Extension Node for ComfyUI
GNU General Public License v3.0
1.09k stars 114 forks source link

Invalid Load Key error with ReActorMaskHelper node #276

Closed aphaits closed 1 month ago

aphaits commented 2 months ago

First, confirm

What happened?

tried the node, error comes out

Steps to reproduce the problem

testing out mask helper node, basic test setup Screenshot 2024-04-17 115844

Sysinfo

Windows 10, Firefox, Zotac 2070 Super

Relevant console log

Error occurred when executing ReActorMaskHelper:

invalid load key, '\x0a'.

  File "F:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\StableDiffusion\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 "F:\StableDiffusion\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 "F:\StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 679, in execute
    sam = sam_model_registry[model_kind](checkpoint=sam_modelname)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\StableDiffusion\ComfyUI_windows_portable\python_embeded\Lib\site-packages\segment_anything\build_sam.py", line 38, in build_sam_vit_b
    return _build_sam(
           ^^^^^^^^^^^
  File "F:\StableDiffusion\ComfyUI_windows_portable\python_embeded\Lib\site-packages\segment_anything\build_sam.py", line 105, in _build_sam
    state_dict = torch.load(f)
                 ^^^^^^^^^^^^^
  File "F:\StableDiffusion\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\serialization.py", line 1040, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\StableDiffusion\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\serialization.py", line 1258, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Additional information

No response

Gourieff commented 2 months ago

Please use another SAM model Just download one of these https://huggingface.co/datasets/Gourieff/ReActor/tree/main/models/sams

kellyling80 commented 2 months ago

Getting the same error as above, even after using

Please use another SAM model Just download one of these https://huggingface.co/datasets/Gourieff/ReActor/tree/main/models/sams

Still getting the same error as OP. Tried downloading the SAM models again , same issue.

magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, '<'.

Gourieff commented 2 months ago

Make sure you are using the correct bbox model as well