mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[GH-ISSUE #137] ValueError: infer_schema(func): Parameter kernel_size has unsupported type list[int] in eager/na.py #43
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Poldino95 on GitHub (Aug 25, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/137
Bug Description:
When running ComfyUI with PyTorch 2.6+, loading
comfy_kitchenfails with aValueErrorduringinfer_schemaincomfy_kitchen/backends/eager/na.py.PyTorch's
custom_optyping inspection rejects built-inlist[int]andlist[bool]type hints, requiringtyping.Listinstead.Error Traceback:
"
ValueError: infer_schema(func): Parameter kernel_size has unsupported type list[int]. The valid types are: ... Got func with signature (q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, kernel_size: list[int], is_causal: list[bool], scale: float | None) -> torch.Tensor)
"
Proposed Fix:
Import List from typing and update the function signature in comfy_kitchen/backends/eager/na.py:
"
from typing import List
(......)
def _op_na3d(
q: torch.Tensor,
k: torch.Tensor,
v: torch.Tensor,
kernel_size: List[int],
is_causal: List[bool],
scale: float | None = None,
) -> torch.Tensor:
(......)
"
@0xDELUXA commented on GitHub (Aug 25, 2026):
Since
github.com/Comfy-Org/comfy-kitchen@05c5f01978, PyTorch 2.7.0 is the minimum required version. Please update PyTorch, and this will resolve the issue.@Poldino95 commented on GitHub (Aug 25, 2026):
yeah but, everything was working fine: i had the version from many months ago, and then I decided to do a full-update, using the .bat script. after that, everything was broken:
"Traceback (most recent call last):
File "\ComfyUI\main.py", line 248, in
import comfy.utils
File "\ComfyUI\comfy\utils.py", line 25, in
import comfy.memory_management
File "\ComfyUI\comfy\memory_management.py", line 8, in
from comfy.quant_ops import QuantizedTensor
File "\ComfyUI\comfy\quant_ops.py", line 23, in
import comfy_kitchen as ck
File "\python_embeded\Lib\site-packages\comfy_kitchen_init_.py", line 3, in
from .backends import cuda as cuda_backend
File "\python_embeded\Lib\site-packages\comfy_kitchen\backends\cuda_init.py", line 161, in
from comfy_kitchen.backends.eager import rope as eager_rope
File "\python_embeded\Lib\site-packages\comfy_kitchen\backends\eager_init.py", line 71, in
from .na import na3d
File "\python_embeded\Lib\site-packages\comfy_kitchen\backends\eager\na.py", line 163, in
@torch.library.custom_op("comfy_kitchen::na3d", mutates_args=())
File "\python_embeded\Lib\site-packages\torch_library\custom_ops.py", line 121, in inner
schema_str = torch.library.infer_schema(fn, mutates_args=mutates_args)
File "\python_embeded\Lib\site-packages\torch_library\infer_schema.py", line 106, in infer_schema
error_fn(
File "\python_embeded\Lib\site-packages\torch_library\infer_schema.py", line 58, in error_fn
raise ValueError(
ValueError: infer_schema(func): Parameter kernel_size has unsupported type list[int]. The valid types are: dict_keys([<class 'torch.Tensor'>, typing.Optional[torch.Tensor], typing.Sequence[torch.Tensor], typing.List[torch.Tensor], typing.Sequence[typing.Optional[torch.Tensor]], typing.List[typing.Optional[torch.Tensor]], <class 'int'>, typing.Optional[int], typing.Sequence[int], typing.List[int], typing.Optional[typing.Sequence[int]], typing.Optional[typing.List[int]], <class 'float'>, typing.Optional[float], typing.Sequence[float], typing.List[float], typing.Optional[typing.Sequence[float]], typing.Optional[typing.List[float]], <class 'bool'>, typing.Optional[bool], typing.Sequence[bool], typing.List[bool], typing.Optional[typing.Sequence[bool]], typing.Optional[typing.List[bool]], <class 'str'>, typing.Optional[str], typing.Union[int, float, bool], typing.Union[int, float, bool, NoneType], typing.Sequence[typing.Union[int, float, bool]], typing.List[typing.Union[int, float, bool]], <class 'torch.dtype'>, typing.Optional[torch.dtype], <class 'torch.device'>, typing.Optional[torch.device]]). Got func with signature (q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, kernel_size: list[int], is_causal: list[bool], scale: float | None) -> torch.Tensor)".
also, when I updated, cuda was removed (and gave errors), so I had to reinstall it manually. after that, kitchen gave other errors, and I fixed it that way, as I showed in the first message
@0xDELUXA commented on GitHub (Aug 25, 2026):
This issue will only be resolved if you update PyTorch to 2.7.0 or newer. https://github.com/Comfy-Org/ComfyUI/pull/15413 was merged two weeks ago.
@Poldino95 commented on GitHub (Aug 25, 2026):
oh, ok. thank you for the help :)