Fannovel16 / comfyui_controlnet_aux

ComfyUI's ControlNet Auxiliary Preprocessors
Apache License 2.0
1.96k stars 189 forks source link

AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text' #105

Open Pandor-AI opened 9 months ago

Pandor-AI commented 9 months ago

Hi, NewB here. I have trouble with installing the ComfyUI Controlnet node. I used this video (https://www.youtube.com/watch?v=FJwcBTL_voc&list=PLepQO73yVqJY3qTGGeBI7v2C5q4JigoIl&index=1&pp=iAQB) to install it first but then I run into problems with this AttributeError. Also I installed Reactor meanwhile, it may have affected it, no idea..

For Sherlock Holmes:

D:\@ComfyUI_windows_portable - copia>.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --normalvram ** ComfyUI start up time: 2023-11-08 02:33:25.083807

Prestartup times for custom nodes: 0.1 seconds: D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\ComfyUI-Manager

Total VRAM 4096 MB, total RAM 32495 MB xformers version: 0.0.22.post7+cu118 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3050 Laptop GPU : cudaMallocAsync VAE dtype: torch.bfloat16 Using xformers cross attention Adding extra search path checkpoints path/to/stable-diffusion-webui/models/Stable-diffusion Adding extra search path configs path/to/stable-diffusion-webui/models/Stable-diffusion Adding extra search path vae path/to/stable-diffusion-webui/models/VAE Adding extra search path loras path/to/stable-diffusion-webui/models/Lora Adding extra search path loras path/to/stable-diffusion-webui/models/LyCORIS Adding extra search path upscale_models path/to/stable-diffusion-webui/models/ESRGAN Adding extra search path upscale_models path/to/stable-diffusion-webui/models/RealESRGAN Adding extra search path upscale_models path/to/stable-diffusion-webui/models/SwinIR Adding extra search path embeddings path/to/stable-diffusion-webui/embeddings Adding extra search path hypernetworks path/to/stable-diffusion-webui/models/hypernetworks Adding extra search path controlnet path/to/stable-diffusion-webui/models/ControlNet Adding extra search path checkpoints D:\@ComfyUI_ALL_MODELS\checkpoints Adding extra search path clip D:\@ComfyUI_ALL_MODELS\clip Adding extra search path clip_vision D:\@ComfyUI_ALL_MODELS\clip_vision Adding extra search path configs D:\@ComfyUI_ALL_MODELS\configs Adding extra search path controlnet D:\@ComfyUI_ALL_MODELS\controlnet Adding extra search path diffusers D:\@ComfyUI_ALL_MODELS\diffusers Adding extra search path embeddings D:\@ComfyUI_ALL_MODELS\embeddings Adding extra search path gligen D:\@ComfyUI_ALL_MODELS\gligen Adding extra search path hypernetworks D:\@ComfyUI_ALL_MODELS\hypernetworks Adding extra search path loras D:\@ComfyUI_ALL_MODELS\loras Adding extra search path style_models D:\@ComfyUI_ALL_MODELS\style_models Adding extra search path unet D:\@ComfyUI_ALL_MODELS\unet Adding extra search path upscale_models D:\@ComfyUI_ALL_MODELS\upscale_models Adding extra search path vae D:\@ComfyUI_ALL_MODELS\vae Adding extra search path vae_approx D:\@ComfyUI_ALL_MODELS\vae_approx

Loading: ComfyUI-Manager (V0.39.3)

ComfyUI Revision: 1657 [a527d0c7] | Released on '2023-11-07'

Total VRAM 4096 MB, total RAM 32495 MB xformers version: 0.0.22.post7+cu118 Set vram state to: NORMAL_VRAM Device: cuda:0 NVIDIA GeForce RTX 3050 Laptop GPU : cudaMallocAsync VAE dtype: torch.bfloat16 Torch version: 2.1.0+cu118 Traceback (most recent call last): File "D:\@ComfyUI_windows_portable - copia\ComfyUI\nodes.py", line 1735, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\comfyui_controlnet_aux__init.py", line 2, in from .utils import here, create_node_input_types File "D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\comfyui_controlnet_aux\utils.py", line 4, in import cv2 File "D:\@ComfyUI_windows_portable - copia\python_embeded\lib\site-packages\cv2__init__.py", line 181, in bootstrap() File "D:\@ComfyUI_windows_portable - copia\python_embeded\lib\site-packages\cv2\init.py", line 175, in bootstrap if load_extra_py_code_for_module("cv2", submodule, DEBUG): File "D:\@ComfyUI_windows_portable - copia\python_embeded\lib\site-packages\cv2__init.py", line 28, in load_extra_py_code_for_module py_module = importlib.import_module(module_name) File "importlib__init.py", line 126, in import_module File "D:\@ComfyUI_windows_portable - copia\python_embeded\lib\site-packages\cv2\typing\init__.py", line 157, in Prim = typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly] AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Cannot import D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\comfyui_controlnet_aux module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text' Efficiency Nodes: Attempting to add Control Net options to the 'HiRes-Fix Script' Node (comfyui_controlnet_aux add-on)...Failed!

Import times for custom nodes: 0.0 seconds: D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\ComfyUI_SeeCoder 0.0 seconds (IMPORT FAILED): D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\comfyui_controlnet_aux 0.0 seconds: D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\efficiency-nodes-comfyui 0.4 seconds: D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\ComfyUI-Manager 0.8 seconds: D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\comfyui-reactor-node

Starting server

To see the GUI go to: http://127.0.0.1:8188 FETCH DATA from: D:\@ComfyUI_windows_portable - copia\ComfyUI\custom_nodes\ComfyUI-Manager\extension-node-map.json

Thanks so much for your time

Pandor-AI commented 9 months ago

Here is some more

Error occurred when executing KSampler:

The size of tensor a (1280) must match the size of tensor b (640) at non-singleton dimension 1

File "D:\@ComfyUI_windows_portable - copia\ComfyUI\execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(slice_dict(input_data_all, i))) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\nodes.py", line 1237, in sample return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\nodes.py", line 1207, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\sample.py", line 100, in sample samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\samplers.py", line 691, in sample return sample(self.model, noise, positive, negative, cfg, self.device, sampler(), sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\samplers.py", line 597, in sample samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\samplers.py", line 518, in sample return uni_pc.sample_unipc(model_wrap, noise, latent_image, sigmas, sampling_function=sampling_function, max_denoise=self.max_denoise(model_wrap, sigmas), extra_args=extra_args, noise_mask=denoise_mask, callback=callback, variant='bh2', disable=disable_pbar) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 892, in sample_unipc x = uni_pc.sample(img, timesteps=timesteps, skip_type="time_uniform", method="multistep", order=order, lower_order_final=True, callback=callback, disable_pbar=disable) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 730, in sample model_prev_list = [self.model_fn(x, vec_t)] File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 421, in model_fn return self.data_prediction_fn(x, t) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 403, in data_prediction_fn noise = self.noise_prediction_fn(x, t) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 397, in noise_prediction_fn return self.model(x, t) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 329, in model_fn return noise_pred_fn(x, t_continuous) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 297, in noise_pred_fn output = model(x, t_input, model_kwargs) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 883, in lambda input, sigma, kwargs: predict_eps_sigma(model, input, sigma, kwargs), File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\extra_samplers\uni_pc.py", line 858, in predict_eps_sigma return (input - model(input, sigma_in, kwargs)) / sigma File "D:\@ComfyUI_windows_portable - copia\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "D:\@ComfyUI_windows_portable - copia\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(args, kwargs) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\samplers.py", line 264, in forward return self.apply_model(*args, kwargs) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\samplers.py", line 261, in apply_model out = sampling_function(self.inner_model.apply_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\samplers.py", line 249, in sampling_function cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, model_options) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\samplers.py", line 226, in calc_cond_uncond_batch output = model_function(inputx, timestep, c).chunk(batch_chunks) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\model_base.py", line 65, in apply_model model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, extra_conds).float() File "D:\@ComfyUI_windows_portable - copia\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "D:\@ComfyUI_windows_portable - copia\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(args, kwargs) File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 636, in forward h = apply_control(h, control, 'output') File "D:\@ComfyUI_windows_portable - copia\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 258, in apply_control h += ctrl

Pandor-AI commented 9 months ago

I forgot to say that I have updated to the last version of ComfyUI_controlnet_aux but this is what I get anyway..

Pandor-AI commented 9 months ago

Can someone help please? Thanks

Fannovel16 commented 9 months ago

@Pandor-AI Seems like you used the wrong controlnet, e.g. using ControlNet for SDXL on SD1.5 or vice versa.

noahjgreer commented 9 months ago

I am also encountering this issue even while using the matching ControlNet model and checkpoint model versions.

I am running the latest version of ComfyUI and the ControlNet_Aux module.


  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1237, in sample
    return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1207, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 22, in informative_sample
    raise e
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
    return original_sample(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\sample.py", line 100, in sample
    samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 691, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler(), sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 597, in sample
    samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 557, in sample
    samples = getattr(k_diffusion_sampling, "sample_{}".format(sampler_name))(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **extra_options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\k_diffusion\sampling.py", line 503, in sample_dpmpp_2s_ancestral
    denoised = model(x, sigmas[i] * s_in, **extra_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 274, in forward
    out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 264, in forward
    return self.apply_model(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 261, in apply_model
    out = sampling_function(self.inner_model.apply_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 249, in sampling_function
    cond, uncond = calc_cond_uncond_batch(model_function, cond, uncond, x, timestep, max_total_area, model_options)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 226, in calc_cond_uncond_batch
    output = model_function(input_x, timestep_, **c).chunk(batch_chunks)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\model_base.py", line 65, in apply_model
    model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 636, in forward
    h = apply_control(h, control, 'output')
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Documents\ComfyUI\ComfyUI_windows_portable\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 258, in apply_control
    h += ctrl
RuntimeError: The size of tensor a (1280) must match the size of tensor b (640) at non-singleton dimension 1```
anagilabs commented 9 months ago

Hi, were you able to fix the issue, i am getting the same error:

Device: cuda:0 NVIDIA GeForce RTX 3050 Laptop GPU : cudaMallocAsync VAE dtype: torch.bfloat16 Torch version: 2.1.0+cu121 Traceback (most recent call last): File "C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1735, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux__init.py", line 2, in from .utils import here, create_node_input_types File "C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux\utils.py", line 4, in import cv2 File "C:\Users\us\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\cv2__init__.py", line 181, in bootstrap() File "C:\Users\us\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\cv2\init.py", line 175, in bootstrap if load_extra_py_code_for_module("cv2", submodule, DEBUG): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\us\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\cv2__init.py", line 28, in load_extra_py_code_for_module py_module = importlib.import_module(module_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "importlib__init.py", line 126, in import_module File "C:\Users\us\comfyui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\cv2\typing\init__.py", line 157, in Prim = typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly] ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Cannot import C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Import times for custom nodes: 0.0 seconds: C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\canvas_tab 0.0 seconds: C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-tooling-nodes 0.0 seconds: C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus 0.0 seconds: C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale 0.0 seconds (IMPORT FAILED): C:\Users\us\comfyui\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux

anagilabs commented 9 months ago

searched hours on internet, tried all the suggestions given for this issue, not to mention those suggested on comfyui_controlnet_aux github repo page, still getting the error

skylerblack2 commented 9 months ago

I'm getting the same issue.

johnyaudesign commented 8 months ago

Hello, has anyone been able to get this resolved?

I've tried just about every suggestion I can get my hand on. I've got opencv_python-4.7.0.72 installed, along with the contrib_python and python_headless of the same version.

This is definitely caused by ReActor installation for me when ReActor is not used, controlnet works fine. I'm trying to ask on both the ReActor side and here to see if anyone's got a working solution.

Here's a snippet of the errors from my Stability Matrix console, any suggestions much appreciated!

`Traceback (most recent call last): File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\nodes.py", line 1800, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite__init.py", line 1, in from .videohelpersuite.nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\nodes.py", line 16, in from .load_video_nodes import LoadVideoUpload, LoadVideoPath File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\load_video_nodes.py", line 5, in import cv2 File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\cv2__init.py", line 181, in bootstrap() File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\cv2__init.py", line 175, in bootstrap if load_extra_py_code_for_module("cv2", submodule, DEBUG): File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\cv2\init.py", line 28, in load_extra_py_code_for_module py_module = importlib.import_module(module_name) File "importlib__init__.py", line 126, in import_module File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\cv2\typing\init__.py", line 157, in Prim = typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly] AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Cannot import G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text' Traceback (most recent call last): File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\nodes.py", line 1800, in load_custom_node module_spec.loader.exec_module(module) File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\comfyui_controlnet_aux__init.py", line 2, in from .utils import here, create_node_input_types File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\comfyui_controlnet_aux\utils.py", line 4, in import cv2 File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\cv2__init.py", line 181, in bootstrap() File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\cv2__init.py", line 175, in bootstrap if load_extra_py_code_for_module("cv2", submodule, DEBUG): File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\cv2\init.py", line 28, in load_extra_py_code_for_module py_module = importlib.import_module(module_name) File "importlib__init__.py", line 126, in import_module File "G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\venv\lib\site-packages\cv2\typing\init__.py", line 157, in Prim = typing.Union[cv2.gapi.wip.draw.Text, cv2.gapi.wip.draw.Circle, cv2.gapi.wip.draw.Image, cv2.gapi.wip.draw.Line, cv2.gapi.wip.draw.Rect, cv2.gapi.wip.draw.Mosaic, cv2.gapi.wip.draw.Poly] AttributeError: module 'cv2.gapi.wip.draw' has no attribute 'Text'

Cannot import G:\John\Projects\2D\AI\StabilityMatrix-win-x64\Data\Packages\ComfyUI\custom_nodes\comfyui_controlnet_aux module for custom nodes: module 'cv2.gapi.wip.draw' has no attribute 'Text' Efficiency Nodes: Attempting to add Control Net options to the 'HiRes-Fix Script' Node (comfyui_controlnet_aux add-on)...Failed!`

wangwenqiao666 commented 7 months ago

you should use following command: pip install future pip install basicsr

littlbee commented 7 months ago

Solved it, take a look at the solution here: https://www.reddit.com/r/comfyui/comments/185aoyk/animatediff_videohelpersuite_and_reactor_conflict/ Basically: python_embeded\python.exe -m pip uninstall -y opencv-python opencv-contrib-python opencv-python-headless

python_embeded\python.exe -m pip install opencv-python==4.7.0.72