Gourieff / comfyui-reactor-node

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

feat: Allow empty faces image. #226

Closed tommyZZM closed 6 months ago

tommyZZM commented 7 months ago

To handleing the case when processing batch of frame images, some of the images are missing faces.

KurtCocain commented 7 months ago

I've downloaded this file and replaced my current reactor_swapper.py and it did not fix the problem for me. This is my first time testing a pull request on github so, you can tell me if I am supposed to do anything else than just that.

It's the same error except the line number that changes.

`[ReActor] 13:15:52 - STATUS - Working: source face index [0], target face index [1] [ReActor] 13:15:53 - STATUS - Analyzing Source Image... [ReActor] 13:15:56 - STATUS - Analyzing Target Image... [ReActor] 13:15:58 - STATUS - Analyzed Target Image Face(s) 1... ERROR:root:!!! Exception during processing !!! ERROR:root:Traceback (most recent call last): File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\nodes.py", line 234, in execute script.process( File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_faceswap.py", line 81, in process result = swap_face( ^^^^^^^^^^ File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 258, in swap_face target_face, wrong_gender = get_face_single(target_img, target_faces, face_index=face_num, gender_target=gender_target) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 134, in get_face_single return get_face_gender(face,face_index,gender_target,"Target") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "F:\mhm\SDXL\COMFY\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\reactor_swapper.py", line 96, in get_face_gender face_gender = gender[face_index]



IndexError: list index out of range`