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

Error occurred when executing ReActorMaskHelper: pic should be 2/3 dimensional. Got 4 dimensions. #280

Open ckao10301 opened 2 months ago

ckao10301 commented 2 months ago

First, confirm

What happened?

Getting this error when using this LoadVideo node with reactormaskhelper. Works fine with only the reactor face swap node, but when I add the maskhelper node, I get this error.

test workflow attached.

reactor video test workflow.json

Screenshot 2024-04-19 124548 Screenshot 2024-04-19 124833

Steps to reproduce the problem

attached in previous box

Sysinfo

windows comfy portable

Relevant console log

File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\ComfyUI\custom_nodes\comfyui-reactor-node\scripts\r_masking\core.py", line 542, in make_sam_mask_segmented
    predictor.set_image(image, "RGB")
  File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\segment_anything\predictor.py", line 56, in set_image
    input_image = self.transform.apply_image(image)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\segment_anything\utils\transforms.py", line 31, in apply_image
    return np.array(resize(to_pil_image(image), target_size))
                           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\ckao1\OneDrive\Desktop\stable swarm\StableSwarmUI\dlbackend\comfy\python_embeded\Lib\site-packages\torchvision\transforms\functional.py", line 278, in to_pil_image
    raise ValueError(f"pic should be 2/3 dimensional. Got {pic.ndim} dimensions.")
ValueError: pic should be 2/3 dimensional. Got 4 dimensions.

Additional information

No response

Gourieff commented 2 months ago

You should add 2 "Image Batch to Image List" nodes as shown here: image

ckao10301 commented 2 months ago

that worked thanks

ckao10301 commented 2 months ago

[@Gourieff]

(test workflow.json)

I followed your advice and it was working, but after updating the reactor node I am getting this error.

Screenshot 2024-05-03 172601 Screenshot 2024-05-03 172540

Gourieff commented 1 month ago

Try to update ReActor