Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: zero-size array to reduction operation minimum which has no identity #47

Closed
flynet opened this issue May 26, 2024 · 5 comments

Comments

@flynet
Copy link

flynet commented May 26, 2024

Thanks for your work. What this could be ?
Python 3.11.8

got prompt

Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: G:\ComfyUI\models\insightface\models\antelopev2\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: G:\ComfyUI\models\insightface\models\antelopev2\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: G:\ComfyUI\models\insightface\models\antelopev2\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: G:\ComfyUI\models\insightface\models\antelopev2\glintr100.onnx recognition ['None', 3, 112, 112] 127.5 127.5
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: G:\ComfyUI\models\insightface\models\antelopev2\scrfd_10g_bnkps.onnx detection [1, 3, '?', '?'] 127.5 128.0
set det-size: (640, 640)
The config attributes {'interpolation_type': 'linear', 'skip_prk_steps': True} were passed to LCMScheduler, but are not expected and will be ignored. Please verify your scheduler_config.json configuration file.
!!! Exception during processing!!! zero-size array to reduction operation minimum which has no identity
Traceback (most recent call last):
  File "G:\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\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 "G:\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\ComfyUI\custom_nodes\comfyui-instantId-faceswap\node.py", line 321, in faceswap
    p_x1, p_y1, p_x2, p_y2 = getMaskBboxWithPadding(mask_image, padding)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "G:\ComfyUI\custom_nodes\comfyui-instantId-faceswap\node.py", line 91, in getMaskBboxWithPadding
    m_x1 = int(np.min(mask_segments[1]))
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python11\Lib\site-packages\numpy\core\fromnumeric.py", line 2953, in min
    return _wrapreduction(a, np.minimum, 'min', axis, None, out,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python11\Lib\site-packages\numpy\core\fromnumeric.py", line 88, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: zero-size array to reduction operation minimum which has no identity

Error occurred when executing FaceSwapGenerationInpaint:

zero-size array to reduction operation minimum which has no identity
File "G:\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\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 "G:\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\ComfyUI\custom_nodes\comfyui-instantId-faceswap\node.py", line 321, in faceswap
p_x1, p_y1, p_x2, p_y2 = getMaskBboxWithPadding(mask_image, padding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\ComfyUI\custom_nodes\comfyui-instantId-faceswap\node.py", line 91, in getMaskBboxWithPadding
m_x1 = int(np.min(mask_segments[1]))
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python11\Lib\site-packages\numpy\core\fromnumeric.py", line 2953, in min
return _wrapreduction(a, np.minimum, 'min', axis, None, out,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python11\Lib\site-packages\numpy\core\fromnumeric.py", line 88, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@abhinavzspace
Copy link

Getting exactly the same error.

@nosiu
Copy link
Owner

nosiu commented May 27, 2024

do you draw a mask and connect it to the generation node?

@flynet
Copy link
Author

flynet commented May 27, 2024

I'm reffering to workflow examples provided https://github.com/nosiu/comfyui-instantId-faceswap/tree/main/workflows
Can you add to this flow nodes for drawing masks ? and we will test )

@nosiu
Copy link
Owner

nosiu commented May 27, 2024

I'm reffering to workflow examples provided https://github.com/nosiu/comfyui-instantId-faceswap/tree/main/workflows Can you add to this flow nodes for drawing masks ? and we will test )

Right click on LoadImage Node (Original Image, or whatever it is called) and select "Open in MaskEditor"

@flynet
Copy link
Author

flynet commented May 27, 2024

Right, I see what image mask means now.
image
then it throws #22
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants