Comfy-Org/ComfyUI · error · ValueError
SeedVR2 VAE cache input is too short for convolution: input_
Error message
SeedVR2 VAE cache input is too short for convolution: input_len={input_len}, pad_len={pad_len}. What it means
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.
Source
Thrown at comfy/ldm/seedvr/vae.py:266
model.padding = orig_padding
class MemoryState(Enum):
DISABLED = 0
INITIALIZING = 1
ACTIVE = 2
UNSET = 3
def get_cache_size(conv_module, input_len, pad_len, dim=0):
dilated_kernel_size = conv_module.dilation[dim] * (conv_module.kernel_size[dim] - 1) + 1
output_len = (input_len + pad_len - dilated_kernel_size) // conv_module.stride[dim] + 1
remain_len = (
input_len + pad_len - ((output_len - 1) * conv_module.stride[dim] + dilated_kernel_size)
)
overlap_len = dilated_kernel_size - conv_module.stride[dim]
cache_len = overlap_len + remain_len
if output_len <= 0:
raise ValueError(
f"SeedVR2 VAE cache input is too short for convolution: input_len={input_len}, pad_len={pad_len}."
)
return cache_len
class DiagonalGaussianDistribution(object):
def __init__(self, parameters: torch.Tensor):
self.parameters = parameters
self.mean, self.logvar = torch.chunk(parameters, 2, dim=1)
self.logvar = torch.clamp(self.logvar, BYTEDANCE_LOGVAR_CLAMP_MIN, BYTEDANCE_LOGVAR_CLAMP_MAX)
def mode(self):
return self.mean
class SpatialNorm(nn.Module):
def __init__(
self,
f_channels: int,
zq_channels: int,View on GitHub (pinned to 1c6d8d45b3)
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.
Example fix
# before vae.decode(latent, tile=(1, 256, 256)) # temporal tile 1 < kernel 3 # after vae.decode(latent, tile=(3, 256, 256)) # >= dilated kernel size
Defensive patterns
Strategy: validation
Validate before calling
def min_slice_len(conv, dim=0):
return conv.dilation[dim] * (conv.kernel_size[dim] - 1) + 1
def validate_tile(conv, tile_len, dim=0):
need = min_slice_len(conv, dim)
if tile_len < need:
raise ValueError(f"tile length {tile_len} below minimum {need} for this conv")
return tile_len Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- SeedVR2 VAE cache size {next_cache_size} exceeds split size
- SeedVR2 VAE cache size {cache_size} exceeds input length {in
- SeedVR2 VAE convolution requires an explicit MemoryState.
- SeedVR2 upsample expected {self.channels} channels, got {hid
- SeedVR2 downsample expected {self.channels} channels, got {h
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/52343055cb29aea4.
Report an issue: GitHub.