rgthree-comfy icon indicating copy to clipboard operation
rgthree-comfy copied to clipboard

ComfyUI, v0.3.50 - Any Switch (rgthree)

Open juergens1967 opened this issue 1 year ago • 12 comments

ComfyUI generates the error "No input found for flattened id [] slot [0]" for nodes which are connected to the entrances of the Any Switch (rgthree) and get no variables from muted groups. The error also appears on the new subgraphs in ComfyUI if they are deactivated. (See reddit: https://www.reddit.com/r/comfyui/comments/1mk1svq/subgraph_is_now_in_comfyui/ from moutonrebelle (15.08.2025)). So I think it has something to do with the error handling of the subgraphs.

juergens1967 avatar Aug 16 '25 18:08 juergens1967

Hmm.. I'm not getting any errors and I've been testing Any Switches in and out and connected to SubGraphs. Are you sure this is an Any Switch issue?

rgthree avatar Aug 16 '25 18:08 rgthree

Oh, this was quick. 😉 I missed to write down the information, that the node ids belong to connected Get-Nodes. The error appears only on the Any Switch with connected Get-Nodes.

juergens1967 avatar Aug 16 '25 18:08 juergens1967

Ah I see. This sounds like it may be a bug in the Get-Nodes, have you filed a bug there?

rgthree avatar Aug 17 '25 00:08 rgthree

No, I don't, because as I removed the Any Switch, the active node worked as expected. But it makes sense, what you say. 👍 B.t.w., let me say thank you for your precious node set. It makes my life so much easier.🤗

juergens1967 avatar Aug 17 '25 03:08 juergens1967

Hi, I have the same issue with ComfyUI v0.3.50.. something broke the anyswitch with this update.

Afroman4peace avatar Aug 20 '25 21:08 Afroman4peace

@Afroman4peace Are you using the Get-Nodes like @juergens1967 was? Sounds like it could be an issue there...

rgthree avatar Aug 24 '25 17:08 rgthree

@rgthree First, thank you for your awesome nodes :-) I am using the Any Switch to select different image inputs.. like in the workflow I've attached here. I am also using it here to switch between two different guider. This worked before Comfy version V0.3.50. Now I am using Comfy V0.3.52:

Here is the error report: ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute 'model_patcher'

2025-08-24T21:13:20.953940 - Prompt executed in 0.07 seconds 2025-08-24T21:13:24.654018 - got prompt 2025-08-24T21:13:24.723257 - !!! Exception during processing !!! 'list' object has no attribute 'model_patcher' 2025-08-24T21:13:24.740317 - Traceback (most recent call last): File "H:\ComfyUI_windows_portable\ComfyUI\execution.py", line 496, in execute output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "H:\ComfyUI_windows_portable\ComfyUI\execution.py", line 315, in get_output_data return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "H:\ComfyUI_windows_portable\ComfyUI\execution.py", line 289, in _async_map_node_over_list await process_inputs(input_dict, i) File "H:\ComfyUI_windows_portable\ComfyUI\execution.py", line 277, in process_inputs result = f(**inputs) ^^^^^^^^^^^ File "H:\ComfyUI_windows_portable\ComfyUI\comfy_extras\nodes_custom_sampler.py", line 824, in sample latent_image = comfy.sample.fix_empty_latent_channels(guider.model_patcher, latent_image) ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute 'model_patcher'

2025-08-24T21:13:24.742324 - Prompt executed in 0.07 seconds

Here is the same issue when I try to use the switch with two image inputs: 2025-08-24T21:21:54.753480 - loaded partially 128.0 127.999755859375 0 2025-08-24T21:21:56.692791 - !!! Exception during processing !!! 'list' object has no attribute 'model_patcher' 2025-08-24T21:21:56.693794 - Traceback (most recent call last): File "H:\ComfyUI_windows_portable\ComfyUI\execution.py", line 496, in execute output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "H:\ComfyUI_windows_portable\ComfyUI\execution.py", line 315, in get_output_data return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "H:\ComfyUI_windows_portable\ComfyUI\execution.py", line 289, in _async_map_node_over_list await process_inputs(input_dict, i) File "H:\ComfyUI_windows_portable\ComfyUI\execution.py", line 277, in process_inputs result = f(**inputs) ^^^^^^^^^^^ File "H:\ComfyUI_windows_portable\ComfyUI\comfy_extras\nodes_custom_sampler.py", line 824, in sample latent_image = comfy.sample.fix_empty_latent_channels(guider.model_patcher, latent_image) ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute 'model_patcher'

Colossus_Project_V12-int4_fp4_workflow_V1.111.json

Afroman4peace avatar Aug 24 '25 19:08 Afroman4peace

can confirm. Any Switch node doesn't work for "latent_image" and "image" types. It seems if any of the top inputs are null, it doesn't move to the next input. ComfyUI 0.3.59 ComfyUI_frontend v1.27.2

Apollo-Spec01 avatar Sep 11 '25 05:09 Apollo-Spec01

@Apollo-Spec01 can you supply a bare-bones workflow that shows the issue, I can't seem to reproduce.

I'll note here, when you say "any of the top inputs are null" you do mean either disconnected or muted and not bypassed, correct? Bypassing a node does not "null" the value, but tries to pass a value through so connecting it to an Any Switch and expecting Any Switch to "skip" that input is not how it workds.

It's possible ComfyUI changed/broke something with the way their bypassing works and it worked before and now doesn't... but Any Switch is always meant to mute input nodes to skip them. Anyway, just mentioning that, it may not be related.

rgthree avatar Sep 13 '25 18:09 rgthree

@rgthree I am not sure if it is bypassed or muted. The nodes that output any_01 and any_02 are simply inactive. Can't do bare-bones but this is the workflow I am having issues, it was working fine before updates. https://www.mediafire.com/file/00oavz880ypx50n/workflow.json/file

Image This node's output goes to this switch (any_03):

Image Then switch's output is connected to another switch (any_03):

Image

With this config it throws this exception:

Image

But if I remove the connections of any_01 and any_02 from both of the switches then it works (after that it fails for image switches but I think underlying issue is the same). Here is the latent image switch fixed workflow, I removed any_01 and any_02 inputs from the latent_image switches. https://www.mediafire.com/file/bge6svkdckqwvlt/workflow_latent_switch_fixed.json/file

Apollo-Spec01 avatar Sep 13 '25 22:09 Apollo-Spec01

@rgthree I reproduced the issue in a simple workflow. https://www.mediafire.com/file/p7rfvvtvc3u3rvq/bare-bones_workflow.json/file

Apollo-Spec01 avatar Sep 13 '25 22:09 Apollo-Spec01

Thank you! I'm marking this as a duplicate of #582 since the last comment about a fix in ComfyUI_frontend applies here.

rgthree avatar Sep 16 '25 00:09 rgthree