Comfy-Org/ComfyUI · error · ValueError
SeedVR2TemporalChunk: temporal_overlap must be >= 0; got {te
Error message
SeedVR2TemporalChunk: temporal_overlap must be >= 0; got {temporal_overlap}. What it means
SeedVR2TemporalChunk.execute validates the temporal_overlap input (an Int with min=0 in the UI, but force_input means an API or wire can supply anything). A negative value would make the chunk step computation nonsensical, so it fails fast with this message.
Source
Thrown at comfy_extras/nodes_seedvr.py:468
tooltip="The effective latent-frame overlap between adjacent chunks, for Merge SeedVR2 Latents."),
],
)
@classmethod
def execute(cls, latent, temporal_overlap, chunking_mode) -> io.NodeOutput:
samples = latent["samples"]
if samples.ndim != 5:
raise ValueError(
f"SeedVR2TemporalChunk: expected a 5-D video latent (B, C, T, H, W); "
f"got shape {tuple(samples.shape)}."
)
if samples.shape[1] != SEEDVR2_LATENT_CHANNELS:
raise ValueError(
f"SeedVR2TemporalChunk: expected {SEEDVR2_LATENT_CHANNELS} latent channels; "
f"got shape {tuple(samples.shape)}."
)
if temporal_overlap < 0:
raise ValueError(
f"SeedVR2TemporalChunk: temporal_overlap must be >= 0; got {temporal_overlap}."
)
mode = chunking_mode["chunking_mode"]
if mode not in ("auto", "manual"):
raise ValueError(
f"SeedVR2TemporalChunk: chunking_mode must be 'auto' or 'manual'; "
f"got {mode!r}."
)
t_latent = samples.shape[2]
t_pixel = 4 * (t_latent - 1) + 1
if mode == "auto":
free_gb = comfy.model_management.get_free_memory(
comfy.model_management.get_torch_device()) / (1024 ** 3)
mpx_per_frame = (samples.shape[0] * samples.shape[3] * samples.shape[4]) * (BYTEDANCE_VAE_SPATIAL_DOWNSAMPLE ** 2) / 1e6
budget_gb = free_gb - SEEDVR2_CHUNK_RESERVED_GIB - SEEDVR2_CHUNK_SIGMA_K * SEEDVR2_CHUNK_SIGMA_GIB
chunk_latent_max = max(1, int(budget_gb / (SEEDVR2_CHUNK_GIB_PER_MPX_FRAME * mpx_per_frame)))
frames_per_chunk = min(4 * (chunk_latent_max - 1) + 1, t_pixel)View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Clamp the value before queueing: temporal_overlap = max(0, temporal_overlap).
- Keep temporal_overlap between 0 and the chunk's latent length minus 1; typical values are 0-2.
- When computing overlap from other parameters, validate the result is non-negative before building the prompt.
Example fix
# before overlap = desired - safety_margin # can go negative prompt['inputs']['temporal_overlap'] = overlap # after prompt['inputs']['temporal_overlap'] = max(0, overlap)
Defensive patterns
Strategy: validation
Validate before calling
temporal_overlap = max(0, int(temporal_overlap))
Type guard
def is_valid_overlap(v) -> bool:
return isinstance(v, int) and v >= 0 Prevention
- Clamp computed overlaps with max(0, x) before queueing API prompts.
- UI inputs already enforce min=0; only API/wired values need guarding.
- Keep overlap <= chunk latent length - 1.
When it happens
Trigger: Queueing a prompt via the API with temporal_overlap=-1, or wiring an integer source node that computes a negative value into the temporal_overlap input.
Common situations: Programmatic prompt construction that passes a computed overlap like min_overlap - 1 without clamping; workflows authored outside the UI which do not enforce the widget's min=0.
Related errors
- SeedVR2TemporalChunk: frames_per_chunk must be a 4n+1 pixel-
- SeedVR2TemporalMerge: temporal_overlap must be >= 0; got {te
- SeedVR2TemporalChunk: expected a 5-D video latent (B, C, T,
- SeedVR2TemporalChunk: expected {SEEDVR2_LATENT_CHANNELS} lat
- SeedVR2TemporalChunk: chunking_mode must be 'auto' or 'manua
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/29e04a470c8d9110.
Report an issue: GitHub.