ComfyUI, v0.3.50 - Any Switch (rgthree)
ComfyUI generates the error "No input found for flattened id [
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?
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.
Ah I see. This sounds like it may be a bug in the Get-Nodes, have you filed a bug there?
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.🤗
Hi, I have the same issue with ComfyUI v0.3.50.. something broke the anyswitch with this update.
@Afroman4peace Are you using the Get-Nodes like @juergens1967 was? Sounds like it could be an issue there...
@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'
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 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 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
This node's output goes to this switch (any_03):
Then switch's output is connected to another switch (any_03):
With this config it throws this exception:
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
@rgthree I reproduced the issue in a simple workflow. https://www.mediafire.com/file/p7rfvvtvc3u3rvq/bare-bones_workflow.json/file
Thank you! I'm marking this as a duplicate of #582 since the last comment about a fix in ComfyUI_frontend applies here.