AutoGrow + MatchType + allowed_types on a custom node makes invalid connections
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
AutoGrow: the node has a variable number of slots.
MatchType: The slots automatically update to the type of the first connected value.
allowed_types: The set of types that are allowed to be connected at all.
When combining all three features you should have a node where the first slot accepts only one of the `allowed_types`. Subsequent slots only accept the same type that is connected to the first.
### Actual Behavior
It works as expected on the first connection. The second slot takes on the same type as the first. When connecting something to that second slot, the wire connecting to the first slot "pops off", and it is impossible to connect anything to the third slot.
Video showing the issue:
https://github.com/user-attachments/assets/30d264c7-ca07-4b47-9466-7a647c71677b
### Steps to Reproduce
Write a custom node like this (this is taken directly from the [documentation](https://docs.comfy.org/custom-nodes/v3_migration#autogrow), with the addition of supplying `allowed_types`):
```
class TestNodeOoo(io.ComfyNode):
@classmethod
def define_schema(cls):
template_matchtype = io.MatchType.Template("type", allowed_types=(io.Image, io.Latent))
template_autogrow = io.Autogrow.TemplatePrefix(
input=io.MatchType.Input("input", template=template_matchtype),
prefix="input",
)
return io.Schema(
node_id=cls.__name__,
display_name="Test Node",
category="Tests",
inputs=[
io.Autogrow.Input("inputs", template=template_autogrow),
],
outputs=[
io.AnyType.Output("sequence"),
],
)
@classmethod
def execute(cls, items):
return items,
```
Try to connect more than two of the same type things to it.
### Debug Logs
There is no useful output in the log so don't bother reading it. I am posting it only because you insist that I post it.
```powershell
WARNING: You need pytorch with cu130 or higher to use optimized CUDA operations.
Found comfy_kitchen backend cuda: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4']}
Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['apply_rope', 'apply_rope1', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8']}
Checkpoint files will always be loaded safely.
Total VRAM 15938 MB, total RAM 190574 MB
pytorch version: 2.8.0+cu129
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4080 SUPER : cudaMallocAsync
Using async weight offloading with 2 streams
Enabled pinned memory 171516.0
Using pytorch attention
aimdo: /project/src-posix/cuda-funchooks.c:52:DEBUG:aimdo_setup_hooks: hooks successfully installed
aimdo: /project/src/control.c:151:INFO:comfy-aimdo inited for GPU: NVIDIA GeForce RTX 4080 SUPER (VRAM: 15937 MB)
DynamicVRAM support detected and enabled
Python version: 3.13.7 (main, Mar 3 2026, 12:19:54) [GCC 15.2.0]
ComfyUI version: 0.21.0
comfy-aimdo version: 0.3.0
comfy-kitchen version: 0.2.8
ComfyUI frontend version: 1.43.18
[Prompt Server] web root: /ComfyUI/.venv/lib/python3.13/site-packages/comfyui_frontend_package/static
Asset seeder disabled
Import times for custom nodes:
0.0 seconds: /ComfyUI/custom_nodes/comfyui-job-iterator
Context impl SQLiteImpl.
Will assume non-transactional DDL.
Starting server
To see the GUI go to: http://127.0.0.1:8188
```
### Other
Note that this only happens when declaring "allowed_types". Everything works as expected when it is not declared.
Contributor guide
Assessment
This issue has not been assessed yet.