volotat / SD-CN-Animation

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

ValueError: Number of channels in the input image and reference image must match! #104

Closed BigFatherJesus closed 1 year ago

BigFatherJesus commented 1 year ago

For the last 3 days, I have been getting this error when trying to use txt2vid, when I use vid2vid it works fine, I've tried reinstalling the extension, updating, or even rolling back to an older version of the extension but I can't seem to get rid of the issue, my guess is that it has to do with Controllnet but I am unable to verify.

It starts out fine but after the first few (2-3) frames it stops and I get greeted by the error.

System Logs:

INFO:sd_dynamic_prompts.dynamic_prompting:Prompt matrix will create 1 images in a total of 1 batches. 100%|██████████████████████████████████████████████████████████████████████████████████| 15/15 [00:02<00:00, 6.33it/s] Total progress: 15it [00:12, 1.18it/s] INFO:sd_dynamic_prompts.dynamic_prompting:Prompt matrix will create 1 images in a total of 1 batches. 100%|██████████████████████████████████████████████████████████████████████████████████| 15/15 [00:02<00:00, 6.97it/s] Total progress: 15it [00:02, 6.75it/s] INFO:sd_dynamic_prompts.dynamic_prompting:Prompt matrix will create 1 images in a total of 1 batches. 100%|██████████████████████████████████████████████████████████████████████████████████| 12/12 [00:01<00:00, 7.36it/s] Total progress: 100%|██████████████████████████████████████████████████████████████████| 12/12 [00:01<00:00, 6.25it/s] INFO:sd_dynamic_prompts.dynamic_prompting:Prompt matrix will create 1 images in a total of 1 batches.<00:00, 8.10it/s] 100%|████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:00<00:00, 7.38it/s] Total progress: 100%|████████████████████████████████████████████████████████████████████| 6/6 [00:01<00:00, 5.02it/s] An exception occurred while trying to process the frame: Number of channels in the input image and reference image must match! Traceback (most recent call last): File "C:\Users.....\Desktop\AI\stable-diffusion-webui\extensions\SD-CN-Animation\scripts\base_ui.py", line 141, in process yield from txt2vid.start_process(args) File "C:\Users.....\Desktop\AI\stable-diffusion-webui\extensions\SD-CN-Animation\scripts\core\txt2vid.py", line 169, in start_process processed_frame = skimage.exposure.match_histograms(processed_frame, init_frame, channel_axis=-1) File "C:\Users.....\Desktop\AI\stable-diffusion-webui\venv\lib\site-packages\skimage_shared\utils.py", line 406, in fixed_func return func(args, *kwargs) File "C:\Users.....\Desktop\AI\stable-diffusion-webui\venv\lib\site-packages\skimage_shared\utils.py", line 348, in fixed_func return func(args, **kwargs) File "C:\Users.....\Desktop\AI\stable-diffusion-webui\venv\lib\site-packages\skimage\exposure\histogram_matching.py", line 69, in match_histograms raise ValueError('Number of channels in the input image and ' ValueError: Number of channels in the input image and reference image must match!

image

volotat commented 1 year ago

@BigFatherJesus I just updated the code, it should fix your issue, please check it out.

BigFatherJesus commented 1 year ago

@volotat I am still getting the exact same error, thanks for the fast response!

I did update the extension and restart.

volotat commented 1 year ago

@BigFatherJesus My bad. I missed one another line where channels should be truncated. Try again please.

BigFatherJesus commented 1 year ago

@volotat Thanks for the prompt response! Everything works again now, thanks a lot! Great extension btw!