{"record":{"id":"29e04a470c8d9110","repo":"Comfy-Org/ComfyUI","slug":"seedvr2temporalchunk-temporal-overlap-must-be","errorCode":null,"errorMessage":"SeedVR2TemporalChunk: temporal_overlap must be >= 0; got {temporal_overlap}.","messagePattern":"SeedVR2TemporalChunk: temporal_overlap must be >= 0; got (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_seedvr.py","lineNumber":468,"sourceCode":"                              tooltip=\"The effective latent-frame overlap between adjacent chunks, for Merge SeedVR2 Latents.\"),\n            ],\n        )\n\n    @classmethod\n    def execute(cls, latent, temporal_overlap, chunking_mode) -> io.NodeOutput:\n        samples = latent[\"samples\"]\n        if samples.ndim != 5:\n            raise ValueError(\n                f\"SeedVR2TemporalChunk: expected a 5-D video latent (B, C, T, H, W); \"\n                f\"got shape {tuple(samples.shape)}.\"\n            )\n        if samples.shape[1] != SEEDVR2_LATENT_CHANNELS:\n            raise ValueError(\n                f\"SeedVR2TemporalChunk: expected {SEEDVR2_LATENT_CHANNELS} latent channels; \"\n                f\"got shape {tuple(samples.shape)}.\"\n            )\n        if temporal_overlap < 0:\n            raise ValueError(\n                f\"SeedVR2TemporalChunk: temporal_overlap must be >= 0; got {temporal_overlap}.\"\n            )\n        mode = chunking_mode[\"chunking_mode\"]\n        if mode not in (\"auto\", \"manual\"):\n            raise ValueError(\n                f\"SeedVR2TemporalChunk: chunking_mode must be 'auto' or 'manual'; \"\n                f\"got {mode!r}.\"\n            )\n        t_latent = samples.shape[2]\n        t_pixel = 4 * (t_latent - 1) + 1\n\n        if mode == \"auto\":\n            free_gb = comfy.model_management.get_free_memory(\n                comfy.model_management.get_torch_device()) / (1024 ** 3)\n            mpx_per_frame = (samples.shape[0] * samples.shape[3] * samples.shape[4]) * (BYTEDANCE_VAE_SPATIAL_DOWNSAMPLE ** 2) / 1e6\n            budget_gb = free_gb - SEEDVR2_CHUNK_RESERVED_GIB - SEEDVR2_CHUNK_SIGMA_K * SEEDVR2_CHUNK_SIGMA_GIB\n            chunk_latent_max = max(1, int(budget_gb / (SEEDVR2_CHUNK_GIB_PER_MPX_FRAME * mpx_per_frame)))\n            frames_per_chunk = min(4 * (chunk_latent_max - 1) + 1, t_pixel)","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_seedvr.py#L450-L486","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\noverlap = desired - safety_margin  # can go negative\nprompt['inputs']['temporal_overlap'] = overlap\n\n# after\nprompt['inputs']['temporal_overlap'] = max(0, overlap)","handlingStrategy":"validation","validationCode":"temporal_overlap = max(0, int(temporal_overlap))","typeGuard":"def is_valid_overlap(v) -> bool:\n    return isinstance(v, int) and v >= 0","tryCatchPattern":null,"preventionTips":["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."],"tags":["seedvr","chunking","api","validation","integer"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}