Traceback (most recent call last): File "D:\ComfyUI-aki-v1.1\execution.py", line 151, in…
- User
Traceback (most recent call last): File "D:\ComfyUI-aki-v1.1\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "D:\ComfyUI-aki-v1.1\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "D:\ComfyUI-aki-v1.1\execution.py", line 65, in map_node_over_list results.append(getattr(obj, func)(**input_data_all)) File "D:\ComfyUI-aki-v1.1\custom_nodes\ComfyUI-Custom-Scripts\py\show_text.py", line 23, in notify if unique_id and extra_pnginfo and "workflow" in extra_pnginfo[0]: TypeError: argument of type 'NoneType' is not iterable
- Assistant
The error you're encountering is happening because
extra_pnginfoisNoneand you're attempting to check if"workflow"is inextra_pnginfo[0], which is not valid sinceNonecannot be indexed or iterated over. This occurs in theshow_text.pyfile, specifically in thenotifyfunction.Error message breakdown:
TypeError: argument of type 'NoneType' is not iterableindicates that an operation expected an iterable object (like a list, tuple, or string), but got aNoneTypeinstead.
To fix this issue, ensure that
extra_pnginfois neitherNonenor empty before trying to access its elements or iterate over it. Here's how you might adjust thenotifyfunction to include a check forNoneand ensure it's a list or another iterable before proceeding:def notify(self, unique_id, extra_pnginfo): # First, check if `extra_pnginfo` is not None and is iterable if extra_pnginfo is not None and isinstance(extra_pnginfo, (list, tuple)): # Then, proceed to check if "workflow" is in the first element of `extra_pnginfo` if unique_id and "workflow" in extra_pnginfo[0]: # The rest of your code goes here passWith this adjustment, the code first checks whether
extra_pnginfois notNoneand also confirms that it is an instance of either a list or tuple, which are iterable. This way, you prevent the error by ensuring that you're not trying to iterate over or index intoNone.Remember, this is a starting point. Depending on your specific requirements or the nature of
extra_pnginfo, you might need to adjust the condition. Ifextra_pnginfocan be other iterable types beyond lists or tuples, you might need a more comprehensive check.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.