[V3] `COMBO` type output doesn't work in v3 node schema
- 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
Related with: https://github.com/comfyanonymous/ComfyUI/pull/9813
- Some node has a `COMBO` type input (e.g., `sampler_name`/`scheduler` fields in KSampler)
- Another node is a static primitive for this combo type (so, the same combo is the output)
- Both are defined in `v3` schema
- When connecting the primitive's output to the corresponding combo input, the graph should work.
### Actual Behavior
At the last step, the connection itself can be made indeed, but when the graph is executed, the main node errors out.
### Steps to Reproduce
- Use the following test node:
```python
from comfy_api.latest import io as _io, ComfyExtension as _ComfyExtension
from typing_extensions import override as _override
COMBO_MAP: dict[str, int] = {
'int one': 1,
'int two': 2,
'int three': 3,
}
COMBO_OPTIONS: tuple[str, ...] = tuple(COMBO_MAP.keys())
COMBO_INPUT = _io.Combo.Input('qqq', options=COMBO_OPTIONS, default=COMBO_OPTIONS[0])
COMBO_OUTPUT = _io.Combo.Output(
# In v3 schema, IDs must be unique between BOTH lists: inputs and outputs, so `display_name` and uppercase ID:
'QQQ', display_name='qqq', options=COMBO_OPTIONS,
)
def combo_validate(value) -> str:
if value not in COMBO_OPTIONS:
raise ValueError(f"Unknown value: {value!r}")
return str(value) # just in case a string-enum member passed or smth
class TestComboPrim(_io.ComfyNode):
@classmethod
def define_schema(cls) -> _io.Schema:
return _io.Schema(
'TestComboPrim',
display_name="Combo-Primitive (Test)",
category='test',
inputs=[COMBO_INPUT],
outputs=[COMBO_OUTPUT],
# is_output_node=False,
)
@classmethod
def execute(cls, qqq: str) -> _io.NodeOutput:
return _io.NodeOutput(combo_validate(qqq), )
class TestNodeWithCombo(_io.ComfyNode):
@classmethod
def define_schema(cls) -> _io.Schema:
return _io.Schema(
'TestNodeWithCombo',
display_name="Node with Combo (Test)",
category='test',
inputs=[COMBO_INPUT],
outputs=[_io.Int.Output('int')],
# is_output_node=False,
)
@classmethod
def execute(cls, qqq: str) -> _io.NodeOutput:
qqq = combo_validate(qqq)
return _io.NodeOutput(COMBO_MAP[qqq], )
# ----------------------------------------------------------
class TestComboExtension(_ComfyExtension):
@_override
async def get_node_list(self) -> list[type[_io.ComfyNode]]:
return [TestComboPrim, TestNodeWithCombo, ]
async def comfy_entrypoint() -> TestComboExtension:
return TestComboExtension()
```
- Add both nodes to a graph (`Combo-Primitive (Test)`, `Node with Combo (Test)`)
- Add a built-in `Preview Any` node
- Connect all three in a pipe: `Combo-Primitive (Test)` > `Node with Combo (Test)` > `Preview Any`
- Execute the graph
The following error is printed to the console:
```
* TestNodeWithCombo 22:
- Return type mismatch between linked nodes: qqq, received_type(('int one', 'int two', 'int three')) mismatch input_type(COMBO)
```
### Debug Logs
```powershell
Checkpoint files will always be loaded safely.
Total VRAM 4096 MB, total RAM 15741 MB
pytorch version: 2.7.1+cu128
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce GTX 1650 Ti : native
Using pytorch attention
Python version: 3.12.10 (tags/v3.12.10:0cc8128, Apr 8 2025, 12:21:36) [MSC v.1943 64 bit (AMD64)]
ComfyUI version: 0.3.67
ComfyUI frontend version: 1.28.8
[Prompt Server] web root: E:\GIT\ComfyUI-dev\venv\Lib\site-packages\comfyui_frontend_package\static
Import times for custom nodes:
0.0 seconds: E:\GIT\ComfyUI-dev\custom_nodes\_test_node
0.0 seconds: E:\GIT\ComfyUI-dev\custom_nodes\websocket_image_save.py
Context impl SQLiteImpl.
Will assume non-transactional DDL.
No target revision found.
Starting server
To see the GUI go to: http://127.0.0.1:8188
got prompt
Failed to validate prompt for output 19:
* TestNodeWithCombo 22:
- Return type mismatch between linked nodes: qqq, received_type(('int one', 'int two', 'int three')) mismatch input_type(COMBO)
Output will be ignored
Failed to validate prompt for output 34:
* (prompt):
- Required input is missing: source
* PreviewAny 34:
- Required input is missing: source
Output will be ignored
Prompt executed in 0.01 seconds
```
### Other
Originally reported in discord: https://discord.com/channels/1218270712402415686/1415760118724825319
Contributor guide
Assessment
This issue has not been assessed yet.