volotat / SD-CN-Animation

This script allows to automate video stylization task using StableDiffusion and ControlNet.
MIT License
806 stars 61 forks source link

ValueError: operands could not be broadcast together with shapes (1024,512,4) (1024,512,3) #92

Closed Cubey42 closed 1 year ago

Cubey42 commented 1 year ago

I keep getting this when starting,

Traceback (most recent call last): File "H:\NovelAI\stable-diffusion-webui\extensions\SD-CN-Animation\scripts\base_ui.py", line 140, in process yield from vid2vid.start_process(*args) File "H:\NovelAI\stable-diffusion-webui/extensions/sd-cn-animation/scripts\core\vid2vid.py", line 192, in start_process alpha_mask, warped_styled_frame = compute_diff_map(next_flow, prev_flow, prev_frame, curr_frame, sdcn_anim_tmp.prev_frame_styled, args_dict) File "H:\NovelAI\stable-diffusion-webui/extensions/sd-cn-animation/scripts\core\flow_utils.py", line 143, in compute_diff_map diff_mask_stl = np.abs(warped_frame_styled.astype(np.float32) - cur_frame.astype(np.float32)) / 255 ValueError: operands could not be broadcast together with shapes (1024,576,4) (1024,576,3) 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:01<00:00, 8.46it/s] Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:02<00:00, 5.78it/s] An exception occurred while trying to process the frame: operands could not be broadcast together with shapes (1024,576,4) (1024,576,3)

seems in the previews like it starts okay.

volotat commented 1 year ago

Please update the extension and try it out again. Should be fixed now.

A13XIS commented 1 year ago

Same issue here. Updated to newest commit already. Looking at your commit I don't see changes in the files specified in the error. Maybe you forgot to commit some changes?

volotat commented 1 year ago

@A13XIS It seems that I forgot one another place where channels should be truncated. Please check it again. I do not have this issue on my side, so it hard to tell if it is actually fixed or not.

A13XIS commented 1 year ago

@volotat Sorry for the late reply. After I removed and redownloaded the extension, the error went away. Looks like it is fixed now.