Gourieff / comfyui-reactor-node

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

Error occurred when executing ReActorFaceSwap #392

Open wiam-saeed opened 4 weeks ago

wiam-saeed commented 4 weeks ago

First, confirm

What happened?

when i use face restore models the Reactor fast face swap get stop and appear this problem. when i turn face model to (none) the node works. i re download all the models and face detection many times nothing changed

Steps to reproduce the problem

Your workflow Screenshot 2024-08-17 160719

Sysinfo

Browser Microsoft Edge Windows 11 3080 ti gbu

Relevant console log

!!! Exception during processing !!! unexpected EOF, expected 2037213 more bytes. The file might be corrupted.
Traceback (most recent call last):
  File "E:\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 "E:\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 "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 168, in _map_node_over_list
    process_inputs(input_dict, i)
  File "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 157, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 379, in execute
    result = reactor.restore_face(self,result,face_restore_model,face_restore_visibility,codeformer_weight,facedetection)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 221, in restore_face
    self.face_helper = FaceRestoreHelper(1, face_size=faceSize, crop_ratio=(1, 1), det_model=facedetection, save_ext='png', use_parse=True, device=device)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\r_facelib\utils\face_restoration_helper.py", line 109, in __init__
    self.face_parse = init_parsing_model(model_name='parsenet', device=self.device)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\r_facelib\parsing\__init__.py", line 19, in init_parsing_model
    load_net = torch.load(model_path, map_location=lambda storage, loc: storage)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\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 "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\serialization.py", line 1281, in _legacy_load
    typed_storage._untyped_storage._set_from_file(
RuntimeError: unexpected EOF, expected 2037213 more bytes. The file might be corrupted.

Additional information

No response

ltstereo commented 3 weeks ago

I also have the problem, Win 11 RTX4080

Screenshot 2024-08-18 181550

`got prompt
[ReActor] 18:11:25 - STATUS - Working: source face index [0], target face index [0]
[ReActor] 18:11:25 - STATUS - Using Hashed Source Face(s) Model...
[ReActor] 18:11:25 - STATUS - Using Hashed Target Face(s) Model...
[ReActor] 18:11:25 - STATUS - Swapping...
!!! Exception during processing !!! 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "U:\AI\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 "U:\AI\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 "U:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 168, in _map_node_over_list
    process_inputs(input_dict, i)
  File "U:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 157, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "U:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 350, in execute
    script.process(
  File "U:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 101, in process
    result = swap_face(
             ^^^^^^^^^^
  File "U:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 329, in swap_face
    result = face_swapper.get(result, target_face, source_face)
             ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Prompt executed in 0.01 seconds`
ltstereo commented 3 weeks ago

I have reinstalled everything. now it works for me.

fallendogF commented 2 weeks ago

我已经重新安装了所有内容。现在它可以正常工作了。how you do that? i have the same problem

Gourieff commented 2 days ago

RuntimeError: unexpected EOF, expected 2037213 more bytes. The file might be corrupted.

GFPGANv1.3.onnx model file is corrupted, you should download it again or use .pth version instead (much faster) https://huggingface.co/datasets/Gourieff/ReActor/blob/main/models/facerestore_models/GFPGANv1.3.pth