{"record":{"id":"52343055cb29aea4","repo":"Comfy-Org/ComfyUI","slug":"seedvr2-vae-cache-input-is-too-short-for-convoluti","errorCode":null,"errorMessage":"SeedVR2 VAE cache input is too short for convolution: input_len={input_len}, pad_len={pad_len}.","messagePattern":"SeedVR2 VAE cache input is too short for convolution: input_len=(.+?), pad_len=(.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/seedvr/vae.py","lineNumber":266,"sourceCode":"        model.padding = orig_padding\n\nclass MemoryState(Enum):\n    DISABLED = 0\n    INITIALIZING = 1\n    ACTIVE = 2\n    UNSET = 3\n\ndef get_cache_size(conv_module, input_len, pad_len, dim=0):\n    dilated_kernel_size = conv_module.dilation[dim] * (conv_module.kernel_size[dim] - 1) + 1\n    output_len = (input_len + pad_len - dilated_kernel_size) // conv_module.stride[dim] + 1\n    remain_len = (\n        input_len + pad_len - ((output_len - 1) * conv_module.stride[dim] + dilated_kernel_size)\n    )\n    overlap_len = dilated_kernel_size - conv_module.stride[dim]\n    cache_len = overlap_len + remain_len\n\n    if output_len <= 0:\n        raise ValueError(\n            f\"SeedVR2 VAE cache input is too short for convolution: input_len={input_len}, pad_len={pad_len}.\"\n        )\n    return cache_len\n\nclass DiagonalGaussianDistribution(object):\n    def __init__(self, parameters: torch.Tensor):\n        self.parameters = parameters\n        self.mean, self.logvar = torch.chunk(parameters, 2, dim=1)\n        self.logvar = torch.clamp(self.logvar, BYTEDANCE_LOGVAR_CLAMP_MIN, BYTEDANCE_LOGVAR_CLAMP_MAX)\n\n    def mode(self):\n        return self.mean\n\nclass SpatialNorm(nn.Module):\n    def __init__(\n        self,\n        f_channels: int,\n        zq_channels: int,","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/seedvr/vae.py#L248-L284","documentation":"get_cache_size computes how many input frames a cached (streaming) convolution must retain between slices. If the effective input length (chunk + cached frames + padding) is smaller than the dilated kernel size, output_len <= 0 — the conv would produce zero output frames — and the helper raises. This only happens with tiled/sliced VAE execution where the slice length is configured below the receptive field of the conv.","triggerScenarios":"Running SeedVR2 VAE encode/decode with a tile/split size (or extremely short video) whose per-slice temporal length is smaller than dilation*(kernel-1)+1; aggressive memory-limit settings that force tiny temporal slices.","commonSituations":"Low-VRAM users setting very small tiling lengths; processing 1-frame videos with 3D convs whose temporal kernel is 3+; memory_limit values that shrink slices below kernel size.","solutions":["Increase the tile/split size (or the VAE tile settings) so each slice is at least the dilated kernel length in the split dimension.","Raise or disable the memory limit for the VAE pass so slicing does not shrink below kernel size.","For very short videos, avoid temporal slicing in the temporal dimension altogether.","Check conv kernel/dilation in the message-adjacent config to compute the minimum valid slice length: dilation*(kernel_size-1)+1."],"exampleFix":"# before\nvae.decode(latent, tile=(1, 256, 256))  # temporal tile 1 < kernel 3\n# after\nvae.decode(latent, tile=(3, 256, 256))  # >= dilated kernel size","handlingStrategy":"validation","validationCode":"def min_slice_len(conv, dim=0):\n    return conv.dilation[dim] * (conv.kernel_size[dim] - 1) + 1\n\ndef validate_tile(conv, tile_len, dim=0):\n    need = min_slice_len(conv, dim)\n    if tile_len < need:\n        raise ValueError(f\"tile length {tile_len} below minimum {need} for this conv\")\n    return tile_len","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute dilated kernel size before choosing tile/split sizes.","Keep temporal tiles at least as large as the largest temporal kernel in the VAE.","Avoid extreme memory limits that force sub-kernel slices; offload or tile spatially instead."],"tags":["seedvr2","vae","tiling","memory","convolution"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}