kijai / ComfyUI-LivePortraitKJ

ComfyUI nodes for LivePortrait
MIT License
1.4k stars 103 forks source link

Video to Video dynamic mask #102

Open Kruchemundo opened 1 month ago

Kruchemundo commented 1 month ago

Hello, I tried to change mask with dynamic mask from video to make composition more precise, but getting error on "Live Portrait Composite" node. this is an error: Error occurred when executing LivePortraitComposite:

Allocation on device

Error occurred when executing LivePortraitComposite:

Expected size for first two dimensions of batch2 tensor to be: [355, 3] but got: [1, 3].

File "c:\AI_programs\Comfyui\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\AI_programs\Comfyui\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 "c:\AI_programs\Comfyui\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI_programs\Comfyui\ComfyUI\custom_nodes\ComfyUI-LivePortraitKJ\nodes.py", line 438, in process mask_ori = _transform_img_kornia( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI_programs\Comfyui\ComfyUI\custom_nodes\ComfyUI-LivePortraitKJ\liveportrait\utils\crop.py", line 64, in _transform_img_kornia img_warped = KGT.warp_affine(img, M, _dsize, mode=flags, padding_mode=borderMode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\AI_programs\Comfyui\python_embeded\Lib\site-packages\kornia\geometry\transform\imgwarp.py", line 198, in warp_affine grid = F.affine_grid(src_norm_trans_dst_norm[:, :2, :], [B, C, dsize[0], dsize[1]], align_corners=align_corners) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\AI_programs\Comfyui\python_embeded\Lib\site-packages\torch\nn\functional.py", line 4445, in affine_grid return torch.affine_grid_generator(theta, size, align_corners) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Is there a way to do it or it is just not possible. Thank you for your time! Best Regards Kruchemundo

Quasimondo commented 1 month ago

Please check out the latest version - there was a patch added yesterday that allows to use multi-frame masks

Kruchemundo commented 1 month ago

Thank you so much!!! Working now, This morning I got it from "Pull Request" changed a line and now work :-))) Thank you for great work!!! Thank you to Kijai for implementation.