ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

'NoneType' object is not subscriptable

Open eyalgi11 opened this issue 2 years ago • 5 comments

Error occurred when executing PreviewImage: 'NoneType' object is not subscriptable

File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 154, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 84, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 77, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1415, in save_images full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0]) ~~~~~~^^^

hi there i get this error from this workflow: workflow.json

workflow is from: https://www.reddit.com/r/comfyui/comments/17qec73/sillytavern_character_expression_workflow/ there is tutorial there on how to use

i using windows, rtx 3090, i7 if there is anything more i need to supply just ask thank you for your help :)

eyalgi11 avatar Jan 12 '24 10:01 eyalgi11

You're getting a nonetype error with the save_image function, which means the save image node is not receiving the input it expects.

Have you attempted to investigate what is being passed through that socket?

poisenbery avatar Jan 13 '24 18:01 poisenbery

sorry for my ignorance but i don't know what is socket, and how to check it in comfyui with this workflow

eyalgi11 avatar Jan 16 '24 13:01 eyalgi11

I am receiving a very similar error

Error occurred when executing PreviewImage:

'NoneType' object is not subscriptable

File "C:\Users\<redacted>\pinokio\api\comfyui.pinokio.git\ComfyUI\execution.py", line 155, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\Users\<redacted>\pinokio\api\comfyui.pinokio.git\ComfyUI\execution.py", line 85, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "C:\Users\<redacted>\pinokio\api\comfyui.pinokio.git\ComfyUI\execution.py", line 78, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\Users\<redacted>\pinokio\api\comfyui.pinokio.git\ComfyUI\nodes.py", line 1415, in save_images
full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0])

W10, RTX4090 24GBVRAM, i7-12700K, 32GB DDR5, Using Pinokio to 1 click run Comfy-UI.

I used a simpler workflow of mine and i have no issues, but when i use a complex workflow it seems I have the exact same error and my workflow crashes. Any help or guidance would be greatly appreciated.

RyzeNGrind avatar Jan 17 '24 07:01 RyzeNGrind

I am using the portable ComfyUI. I am getting a similar error after substituting missing nodes with relevant ones from the following workflow:

https://openart.ai/workflows/guppy_each_15/change-pose/CeuZsuI2io4oINRGwl1P

My error is:

Error occurred when executing PreviewImage:

'NoneType' object is not subscriptable

File "C:\new_ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\new_ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\new_ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\new_ComfyUI_windows_portable_nvidia_cu121_or_cpu\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1431, in save_images full_output_folder, filename, counter, subfolder, filename_prefix = folder_paths.get_save_image_path(filename_prefix, self.output_dir, images[0].shape[1], images[0].shape[0]) ~~~~~~^^^

vivekchakraverty avatar Jul 07 '24 13:07 vivekchakraverty

Error occurred when executing DeforumKSampler:

'NoneType' object is not subscriptable

File "D:\ComfyUI-aki-v1.3\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "D:\ComfyUI-aki-v1.3\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "D:\ComfyUI-aki-v1.3\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "D:\ComfyUI-aki-v1.3\custom_nodes\deforum-comfy-nodes\deforum_nodes\nodes\deforum_sampler_nodes.py", line 28, in sample latent["samples"] = latent["samples"].float()

I have the same question, looking for a solution!

Erica0513 avatar Aug 21 '24 02:08 Erica0513

anyone fixed this yet ?

Raykarr avatar Dec 18 '24 04:12 Raykarr

This issue does not arise from a single cause, nor does it occur solely within the node where the error is detected. Typically, it happens when the input passed to the node where the error occurs is already corrupted.

A representative example is when an incorrect model file is loaded. Another case is when a custom node produces incorrect output.

You need to handle each case on a case-by-case basis.

ltdrdata avatar Dec 18 '24 05:12 ltdrdata

The solution to resolving my error was to add the correct config.json that belongs with the model into the same folder as the model. The model loader node was then able to find the model file and load properly. image

PyrateGFXProductions avatar Dec 30 '24 07:12 PyrateGFXProductions

look at your workflow and see where it stopped. the node should be red. maybe just a missing model

geswut-chxbut avatar Apr 01 '25 02:04 geswut-chxbut

This is a generic error, I demonstrate an example of it here. In my case it indicated a conflict caused by the downstream Impact Switch (which has been patched now). So the error could be caused by a completely silent node. Logs won't help here.

Tekaiguy avatar Aug 13 '25 12:08 Tekaiguy

Image I met the same problem!Although the workflow I use is different from the one you are having issues with, based on how I resolved this bug, it appears that the “preview image” node connected to the transition node outside the image became the first node to enter the IPadapter node. Therefore, you need to disconnect the pink wire shown in the figure, and connect the two nodes according to the white wire shown in the figure. Regardless of whether my solution is suitable for your situation, I hope you will ultimately be able to resolve this issue!

Cyuep avatar Aug 21 '25 08:08 Cyuep

Image I met the same problem!Although the workflow I use is different from the one you are having issues with, based on how I resolved this bug, it appears that the “preview image” node connected to the transition node outside the image became the first node to enter the IPadapter node. Therefore, you need to disconnect the pink wire shown in the figure, and connect the two nodes according to the white wire shown in the figure. Regardless of whether my solution is suitable for your situation, I hope you will ultimately be able to resolve this issue!

Your workflow has missing nodes that are not installed. Please resolve them first before proceeding.

ltdrdata avatar Aug 21 '25 09:08 ltdrdata