The exact same code would run on my Zorin OS PC, but not Ubuntu 26.04. The fix was as per below:
Edit the file:
nano /home/ubuntu/comfy/ComfyUI/custom_nodes/comfyui_layerstyle/py/person_mask_ultra_v2.py
Find Line:
condition = np.stack((mask.numpy_view(),) * image_shape[-1], axis=-1) > confidence
Replace with:
mask_view = mask.numpy_view()
if mask_view.ndim == 3 and mask_view.shape[-1] == 1:
mask_view = mask_view.squeeze(-1)
condition = np.stack((mask_view,) * image_shape[-1], axis=-1) > confidence
it's inconsistent across environments (worked on one PC, failed on another with identical package versions) — pointing to a MediaPipe version/build quirk in how .numpy_view() shapes its output.
I hope this helps someone in the future.
The exact same code would run on my Zorin OS PC, but not Ubuntu 26.04. The fix was as per below:
Edit the file:
nano /home/ubuntu/comfy/ComfyUI/custom_nodes/comfyui_layerstyle/py/person_mask_ultra_v2.py
Find Line:
condition = np.stack((mask.numpy_view(),) * image_shape[-1], axis=-1) > confidence
Replace with:
mask_view = mask.numpy_view()
if mask_view.ndim == 3 and mask_view.shape[-1] == 1:
mask_view = mask_view.squeeze(-1)
condition = np.stack((mask_view,) * image_shape[-1], axis=-1) > confidence
it's inconsistent across environments (worked on one PC, failed on another with identical package versions) — pointing to a MediaPipe version/build quirk in how .numpy_view() shapes its output.
I hope this helps someone in the future.