Ryuukeisyou / comfyui_face_parsing

A set of custom nodes for ComfyUI. The nodes utilize the face parsing model to provide detailed segmantation of face.
57 stars 4 forks source link

Error in GuidedFilter(FaceParsing) Node: No Attribute 'guidedFilter' #4

Open Poukpalaova opened 4 months ago

Poukpalaova commented 4 months ago

Description

Encountered an error while executing the GuidedFilter(FaceParsing) node within a workflow shared in another post, which includes a comparison operation. It's unclear what should be provided in the guide input of that node. Also, what is the version of opencv-contrib-python to be used? In the requirements.txt there is no version therefore the latest is installing (4.9.0.80).

Error Message:

The following error message is received when executing the node: Error occurred when executing GuidedFilter(FaceParsing):

module 'cv2.ximgproc' has no attribute 'guidedFilter'

Traceback (most recent call last): File "M:\AIgenerated\StableDiffusion\ComfyUI2\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "M:\AIgenerated\StableDiffusion\ComfyUI2\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "M:\AIgenerated\StableDiffusion\ComfyUI2\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "M:\AIgenerated\StableDiffusion\ComfyUI2\custom_nodes\comfyui_face_parsing\face_parsing_nodes.py", line 923, in guided_filter result_cv2 = cv2.ximgproc.guidedFilter(guide_cv2, image_cv2, radius, eps) AttributeError: module 'cv2.ximgproc' has no attribute 'guidedFilter'

Console output:

ERROR:root:!!! Exception during processing !!! ERROR:root:Traceback (most recent call last): File "M:\AIgenerated\StableDiffusion\ComfyUI2\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "M:\AIgenerated\StableDiffusion\ComfyUI2\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "M:\AIgenerated\StableDiffusion\ComfyUI2\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "M:\AIgenerated\StableDiffusion\ComfyUI2\custom_nodes\comfyui_face_parsing\face_parsing_nodes.py", line 923, in guided_filter result_cv2 = cv2.ximgproc.guidedFilter(guide_cv2, image_cv2, radius, eps) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'cv2.ximgproc' has no attribute 'guidedFilter'

Prompt executed in 0.05 seconds

Environment

ComfyUI version: (specify the version if known) Python version: 3.11.6 CUDA/CuDNN version: cudnn 12.1 Hardware specs: VRAM: 24563 MB RAM: 32693 MB GPU: NVIDIA GeForce RTX 4090 Additional Libraries: torch: 2.1.2+cu121 torchaudio: 2.1.2+cu121 torchmetrics: 1.3.0.post0 torchsde: 0.2.6 torchvision: 0.16.2+cu121 xformers: 0.0.23.post1 opencv-contrib-python: 4.9.0.80 opencv-python: 4.9.0.80 opencv-python-headless: 4.7.0.72

Steps to Reproduce

-Normal installation of ComfyUI (non-portable version). -Execute the GuidedFilter(FaceParsing) node with the mentioned configuration. -Encounter the attribute error regarding 'cv2.ximgproc'.

Expected Behavior

GuidedFilter should execute without errors, processing the inputs as intended.

Actual Behavior

The execution fails due to the missing 'guidedFilter' attribute in 'cv2.ximgproc'.

Ryuukeisyou commented 4 months ago

the version of opencv-contrib-python is fine. i guess it's probabaly because of the installation of other versions of opencv, as mentioned in readme. please try uninstalling and reinstalling and see if it work.

LushLushh commented 3 months ago

I have the same problem. in the example workflow there's nothing inside the guide input; https://github.com/Ryuukeisyou/comfyui_face_parsing/blob/main/demo/workflow.png What type of input does it expect?

GuidedFilter(FaceParsing) node

Ryuukeisyou commented 2 weeks ago

I have the same problem. in the example workflow there's nothing inside the guide input; https://github.com/Ryuukeisyou/comfyui_face_parsing/blob/main/demo/workflow.png What type of input does it expect?

GuidedFilter(FaceParsing) node

as far as i know the guide can be an image to guide the filter but i dont fully understand the mechanism of the algorithm. by default, if you leave the input empty it will use the input image as guide and this seem to work fine.