{"record":{"id":"a4923b8ca1e024da","repo":"Comfy-Org/ComfyUI","slug":"kernel-size-must-be-greater-than-1-use-make-linea","errorCode":null,"errorMessage":"kernel_size must be greater than 1. Use make_linear_nd instead.","messagePattern":"kernel_size must be greater than 1\\. Use make_linear_nd instead\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/lightricks/vae/dual_conv3d.py","lineNumber":32,"sourceCode":"        out_channels,\n        kernel_size,\n        stride: Union[int, Tuple[int, int, int]] = 1,\n        padding: Union[int, Tuple[int, int, int]] = 0,\n        dilation: Union[int, Tuple[int, int, int]] = 1,\n        groups=1,\n        bias=True,\n        padding_mode=\"zeros\",\n    ):\n        super(DualConv3d, self).__init__()\n\n        self.in_channels = in_channels\n        self.out_channels = out_channels\n        self.padding_mode = padding_mode\n        # Ensure kernel_size, stride, padding, and dilation are tuples of length 3\n        if isinstance(kernel_size, int):\n            kernel_size = (kernel_size, kernel_size, kernel_size)\n        if kernel_size == (1, 1, 1):\n            raise ValueError(\n                \"kernel_size must be greater than 1. Use make_linear_nd instead.\"\n            )\n        if isinstance(stride, int):\n            stride = (stride, stride, stride)\n        if isinstance(padding, int):\n            padding = (padding, padding, padding)\n        if isinstance(dilation, int):\n            dilation = (dilation, dilation, dilation)\n\n        # Set parameters for convolutions\n        self.groups = groups\n        self.bias = bias\n\n        # Define the size of the channels after the first convolution\n        intermediate_channels = (\n            out_channels if in_channels < out_channels else in_channels\n        )\n","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/lightricks/vae/dual_conv3d.py#L14-L50","documentation":"Raised by DualConv3d.__init__ when kernel_size resolves to (1,1,1). A 1x1x1 'convolution' is a pointwise projection and DualConv3d's split spatial/temporal machinery is pointless overhead for it, so the constructor redirects you to make_linear_nd.","triggerScenarios":"Constructing DualConv3d(kernel_size=1) or make_conv_nd(dims=(2,1), kernel_size=1) — the latter forwards to DualConv3d and hits the guard.","commonSituations":"Config-driven code that sets kernel_size per block and accidentally uses 1 for a pointwise block; reusing a conv factory call template with a wrong kernel size.","solutions":["Use make_linear_nd(dims=(2,1), in_channels, out_channels) instead of make_conv_nd for 1x1 projections","If a real convolution was intended, set kernel_size >= 2 (e.g. 3)","Check the block config's kernel_size field for a stray 1"],"exampleFix":"# before\nconv = make_conv_nd((2, 1), c_in, c_out, kernel_size=1)\n\n# after\nconv = make_linear_nd((2, 1), c_in, c_out)","handlingStrategy":"validation","validationCode":"ks = (kernel_size,) * 3 if isinstance(kernel_size, int) else tuple(kernel_size)\nif ks == (1, 1, 1):\n    layer = make_linear_nd((2, 1), in_channels, out_channels)\nelse:\n    layer = make_conv_nd((2, 1), in_channels, out_channels, kernel_size)","typeGuard":"def is_pointwise_kernel(ks) -> bool:\n    ks = (ks,) * 3 if isinstance(ks, int) else tuple(ks)\n    return ks == (1, 1, 1)","tryCatchPattern":null,"preventionTips":["Route 1x1 projections to make_linear_nd, never make_conv_nd with kernel_size=1","Validate per-block kernel_size values in configs before building the VAE"],"tags":["convolution","dual-conv3d","factory","ltx"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}