Comfy-Org/ComfyUI · error · ValueError
SeedVR2 VAE cache size {next_cache_size} exceeds split size
Error message
SeedVR2 VAE cache size {next_cache_size} exceeds split size {x[idx].size(split_dim)}. What it means
In the slicing path of the SeedVR2 VAE conv, the number of frames that must be carried into the next slice (next_cache_size, derived from kernel/stride/dilation overlap plus remainder) is compared against the current slice length. If the cache the conv wants to keep is larger than the slice itself, the slicing scheme cannot make progress and raises. Effectively the slice size is too small for this conv's receptive field/stride combination.
Source
Thrown at comfy/ldm/seedvr/vae.py:555
lpad_dim = (x[idx].ndim - split_dim - 1) * 2
rpad_dim = lpad_dim + 1
padding = list(padding)
padding[lpad_dim] = self.padding[split_dim - 2] if idx == 0 else 0
padding[rpad_dim] = self.padding[split_dim - 2] if idx == len(x) - 1 else 0
pad_len = padding[lpad_dim] + padding[rpad_dim]
padding = tuple(padding)
next_cache = None
cache_len = cache.size(split_dim) if cache is not None else 0
next_cache_size = get_cache_size(
conv_module=self,
input_len=x[idx].size(split_dim) + cache_len,
pad_len=pad_len,
dim=split_dim - 2,
)
if next_cache_size != 0:
if next_cache_size > x[idx].size(split_dim):
raise ValueError(
f"SeedVR2 VAE cache size {next_cache_size} exceeds split size {x[idx].size(split_dim)}."
)
next_cache = (
x[idx].transpose(0, split_dim)[-next_cache_size:].transpose(0, split_dim)
)
x[idx] = self.memory_limit_conv(
x[idx],
split_dim=split_dim + 1,
padding=padding,
prev_cache=cache
)
cache = next_cache
output = torch.cat(x, dim=split_dim)
return output
View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Increase the slice/chunk size for the affected dimension (larger tile, larger split).
- Relax the memory limit so fewer, larger slices are used.
- Avoid splitting the affected dimension at all (e.g. split spatially instead of temporally for temporal-heavy convs).
- Compute minimum slice length from conv params before choosing a split: slice >= dilated_kernel - stride + 1.
Defensive patterns
Strategy: validation
Validate before calling
def min_chunk_for_conv(kernel, stride, dilation):
dilated = dilation * (kernel - 1) + 1
return dilated - stride + 1
# before splitting a dim for SeedVR2 VAE convs:
# assert chunk >= min_chunk_for_conv(k, s, d) Prevention
- Never split a dimension below the conv's overlap requirement (dilated kernel - stride + 1).
- Raise memory limits rather than shrinking slices below kernel size.
- Split spatial dims preferentially for temporally-heavy 3D convs.
When it happens
Trigger: memory_limit-driven splitting that produces slices shorter than the conv's overlap (dilated_kernel - stride) plus remainder; stride > 1 temporal convs with small slices; user-configured split sizes below kernel size.
Common situations: Very low memory_limit forcing tiny spatial/temporal chunks; decoding small videos with large-kernel 3D convs; custom tiling code that chunks arbitrarily.
Related errors
- SeedVR2 VAE cache input is too short for convolution: input_
- 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/16e18fc0a91e4b6f.
Report an issue: GitHub.