WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.22k stars 178 forks source link

TypeError: remove() got an unexpected keyword argument 'bgcolor' #339

Open sntsris opened 9 months ago

sntsris commented 9 months ago

Hi there,

I encountered a runtime error while executing a custom node in ComfyUI, specifically within the image processing workflow. The error occurs when calling the remove() function from a custom node designed for background removal. Below is the traceback for the error encountered:

Image Rembg node

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
  File "/notebooks/ComfyUI/execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/notebooks/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 "/notebooks/ComfyUI/execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/notebooks/ComfyUI/custom_nodes/was-node-suite-comfyui/WAS_Node_Suite.py", line 5868, in image_rembg
    remove(
TypeError: remove() got an unexpected keyword argument 'bgcolor'
This error suggests that the remove() function does not recognize 'bgcolor' as a valid keyword argument.

Environment Details:

ComfyUI Version: 19[c5a369] (2024-01-31) I'm not sure if this is an issue with the version of the rembg library being used or if it's an issue with the custom node implementation. Any insights or suggestions on how to resolve this error would be greatly appreciated.

Thank you for your assistance.

WASasquatch commented 9 months ago

I would assume the version of rembg you have is not compatible. I've been using it extensive, and besides a onnx runtime warning, it functions as expected. Can you see what version of rembg you have? For example, as of yesterday, installing a fresh copy of ComfyUI, I obtained the version rembg==2.0.54

(ComfyUI) PS K:\ComfyUI_Main\ComfyUI> pip show rembg
Name: rembg
Version: 2.0.54
Summary: Remove image background
Home-page: https://github.com/danielgatis/rembg
Author: Daniel Gatis
Author-email: danielgatis@gmail.com
License:
Location: k:\comfyui_main\comfyui\lib\site-packages
Requires: jsonschema, numpy, onnxruntime, opencv-python-headless, pillow, pooch, pymatting, scikit-image, scipy, tqdm
Required-by: