DareFail / ComfyUI-Roboflow

Roboflow Workflows on ComfyUI
Apache License 2.0
15 stars 2 forks source link

RemoveBackground "NoneType" error #3

Open iceener opened 3 days ago

iceener commented 3 days ago

Hey đź‘‹

I wanted to try background removal, but got an error: "object of type 'NoneType' has no len()".

Xnapper-2024-09-26-09 56 21

Error details:

# ComfyUI Error Report
## Error Details
- **Node Type:** RemoveBackground
- **Exception Type:** TypeError
- **Exception Message:** object of type 'NoneType' has no len()
## Stack Trace
  File "/Users/username/playground/ComfyUI/execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/username/playground/ComfyUI/execution.py", line 228, in get_output_data
    output = merge_result_data(results, obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/username/playground/ComfyUI/execution.py", line 175, in merge_result_data
    output_is_list = [False] * len(results[0])
                               ^^^^^^^^^^^^^^^

## System Information
- **ComfyUI Version:** v0.2.2-77-g037c315
- **Arguments:** main.py
- **OS:** posix
- **Python Version:** 3.12.6 (main, Sep  6 2024, 19:03:47) [Clang 15.0.0 (clang-1500.3.9.4)]
- **Embedded Python:** false
- **PyTorch Version:** 2.3.1
## Devices

- **Name:** mps
  - **Type:** mps
  - **VRAM Total:** 68719476736
  - **VRAM Free:** 46381465600
  - **Torch VRAM Total:** 68719476736
  - **Torch VRAM Free:** 46381465600

## Logs
2024-09-26 09:43:22,405 - root - INFO - Total VRAM 65536 MB, total RAM 65536 MB
2024-09-26 09:43:22,405 - root - INFO - pytorch version: 2.3.1
2024-09-26 09:43:22,405 - root - INFO - Set vram state to: SHARED
2024-09-26 09:43:22,405 - root - INFO - Device: mps
2024-09-26 09:43:22,959 - root - INFO - Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
2024-09-26 09:43:23,702 - root - INFO - [Prompt Server] web root: /Users/username/playground/ComfyUI/web
2024-09-26 09:43:24,073 - root - INFO - 
Import times for custom nodes:
2024-09-26 09:43:24,073 - root - INFO -    0.0 seconds: /Users/username/playground/ComfyUI/custom_nodes/websocket_image_save.py
2024-09-26 09:43:24,073 - root - INFO -    0.0 seconds: /Users/username/playground/ComfyUI/custom_nodes/ComfyUI-Roboflow
2024-09-26 09:43:24,073 - root - INFO -    0.1 seconds: /Users/username/playground/ComfyUI/custom_nodes/ComfyUI-Manager
2024-09-26 09:43:24,074 - root - INFO - 
2024-09-26 09:43:24,076 - root - INFO - Starting server

2024-09-26 09:43:24,077 - root - INFO - To see the GUI go to: http://127.0.0.1:8188
2024-09-26 09:43:47,328 - root - INFO - got prompt
2024-09-26 09:43:48,590 - root - ERROR - !!! Exception during processing !!! object of type 'NoneType' has no len()
2024-09-26 09:43:48,600 - root - ERROR - Traceback (most recent call last):
  File "/Users/username/playground/ComfyUI/execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/playground/ComfyUI/execution.py", line 228, in get_output_data
    output = merge_result_data(results, obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/playground/ComfyUI/execution.py", line 175, in merge_result_data
    output_is_list = [False] * len(results[0])
                               ^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

2024-09-26 09:43:48,600 - root - INFO - Prompt executed in 1.27 seconds
2024-09-26 09:44:44,483 - root - INFO - got prompt
2024-09-26 09:44:45,611 - root - ERROR - !!! Exception during processing !!! object of type 'NoneType' has no len()
2024-09-26 09:44:45,612 - root - ERROR - Traceback (most recent call last):
  File "/Users/username/playground/ComfyUI/execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/playground/ComfyUI/execution.py", line 228, in get_output_data
    output = merge_result_data(results, obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/playground/ComfyUI/execution.py", line 175, in merge_result_data
    output_is_list = [False] * len(results[0])
                               ^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

2024-09-26 09:44:45,613 - root - INFO - Prompt executed in 1.13 seconds
2024-09-26 09:45:12,977 - root - INFO - got prompt
2024-09-26 09:45:14,171 - root - ERROR - !!! Exception during processing !!! object of type 'NoneType' has no len()
2024-09-26 09:45:14,173 - root - ERROR - Traceback (most recent call last):
  File "/Users/username/playground/ComfyUI/execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/playground/ComfyUI/execution.py", line 228, in get_output_data
    output = merge_result_data(results, obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/playground/ComfyUI/execution.py", line 175, in merge_result_data
    output_is_list = [False] * len(results[0])
                               ^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

2024-09-26 09:45:14,175 - root - INFO - Prompt executed in 1.19 seconds
2024-09-26 09:46:11,118 - root - INFO - got prompt
2024-09-26 09:46:12,214 - root - ERROR - !!! Exception during processing !!! object of type 'NoneType' has no len()
2024-09-26 09:46:12,216 - root - ERROR - Traceback (most recent call last):
  File "/Users/username/playground/ComfyUI/execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/playground/ComfyUI/execution.py", line 228, in get_output_data
    output = merge_result_data(results, obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/playground/ComfyUI/execution.py", line 175, in merge_result_data
    output_is_list = [False] * len(results[0])
                               ^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

2024-09-26 09:46:12,226 - root - INFO - Prompt executed in 1.10 seconds
## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.
{"last_node_id":6,"last_link_id":2,"nodes":[{"id":1,"type":"LoadImage","pos":{"0":75,"1":398},"size":{"0":315,"1":314},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[1],"shape":3},{"name":"MASK","type":"MASK","links":null,"shape":3}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["IMG_7979.JPG","image"]},{"id":6,"type":"PreviewImage","pos":{"0":836.6500244140625,"1":371.7937316894531},"size":{"0":210,"1":26},"flags":{},"order":2,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":2}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"}},{"id":5,"type":"RemoveBackground","pos":{"0":457,"1":386},"size":{"0":330,"1":154},"flags":{},"order":1,"mode":0,"inputs":[{"name":"input_image1","type":"IMAGE","link":1}],"outputs":[{"name":"output_image1","type":"IMAGE","links":[2],"shape":3}],"properties":{"Node name for S&R":"RemoveBackground"},"widgets_values":["","remove-background","","image","polygon_removed_background"]}],"links":[[1,1,0,5,0,"IMAGE"],[2,5,0,6,0,"IMAGE"]],"groups":[{"title":"Group","bounding":[268,105,140,80],"color":"#3f789e","font_size":24,"flags":{}}],"config":{},"extra":{"ds":{"scale":1.1,"offset":[14.139312437855175,5.5093596380059715]}},"version":0.4}

## Additional Context
(Please add any additional context or steps to reproduce the error here)

Do you have any ideas on how to fix it?

DareFail commented 3 days ago

Hey just want to make sure you filled out the workspace_name and input_image1_key?

then try running

input_image1_key is likely “image” as a default

iceener commented 3 days ago

Hey just want to make sure you filled out the workspace_name and input_image1_key?

Yes and the error is the same.

workspace_name should be Workspace name or slug? (tried both)

Maybe it doesn't work on trial?

DareFail commented 3 days ago

Interesting I have a paid account now but it looks free to me

Screenshot 2024-09-26 at 9 39 55 AM

workspace_name name is this section yes

Screenshot 2024-09-26 at 9 41 53 AM

Finally, I hate to ask because its so simple but you uploaded an image in the loader before running? Try running 2 or 3 times just to make sure.