{"record":{"id":"984100f7b2db1c43","repo":"Comfy-Org/ComfyUI","slug":"seedvr2temporalchunk-expected-a-5-d-video-latent","errorCode":null,"errorMessage":"SeedVR2TemporalChunk: expected a 5-D video latent (B, C, T, H, W); got shape {tuple(samples.shape)}.","messagePattern":"SeedVR2TemporalChunk: expected a 5-D video latent \\(B, C, T, H, W\\); got shape (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_seedvr.py","lineNumber":458,"sourceCode":"                                          io.DynamicCombo.Option(\"manual\", [\n                                              io.Int.Input(\"frames_per_chunk\", default=21, min=1, max=16384, step=4,\n                                                           tooltip=\"Pixel frames per temporal chunk (4n+1: 1, 5, 9, 13, ...).\"),\n                                          ]),\n                                      ]),\n            ],\n            outputs=[\n                io.Latent.Output(display_name=\"latents\", is_output_list=True,\n                                 tooltip=\"The temporal chunks in sequence order.\"),\n                io.Int.Output(display_name=\"temporal_overlap\",\n                              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            )","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_seedvr.py#L440-L476","documentation":"SeedVR2TemporalChunk.execute expects latent['samples'] to be a 5-D video latent (B, C, T, H, W). Any other rank — most commonly a 4-D image latent — raises this error echoing the shape so you can see which dimension is missing.","triggerScenarios":"Connecting a 4-D image latent (B, C, H, W) or a 3-D tensor to the Split/TemporalChunk node; or a custom node emitting a non-5-D 'latent' dict.","commonSituations":"Splitting an image-upscaled latent instead of a video latent; workflows copied from image pipelines without the video VAE encode; custom nodes that squeeze the temporal dim for single-frame videos.","solutions":["Feed a 5-D SeedVR2 video latent from the video VAE encode / SeedVR2 sampling chain.","If a single-frame video latent lost its temporal dim, restore it: samples = samples.unsqueeze(2) so shape becomes (B, C, 1, H, W).","Verify samples.ndim == 5 in the upstream node before outputting the latent."],"exampleFix":"# before\nsamples = samples.squeeze(2)  # single frame collapsed to 4-D -> error\n\n# after\nif samples.ndim == 4:\n    samples = samples.unsqueeze(2)  # restore (B, C, 1, H, W)","handlingStrategy":"type-guard","validationCode":"samples = latent['samples']\nif samples.ndim == 4:\n    samples = samples.unsqueeze(2)  # restore temporal dim for 1-frame video latents\nlatent['samples'] = samples\nassert samples.ndim == 5","typeGuard":"def is_5d_latent(samples) -> bool:\n    return samples.ndim == 5","tryCatchPattern":null,"preventionTips":["Keep video latents 5-D through the whole graph.","Only feed SeedVR2-sampled/encoded latents into the chunker.","Watch for custom nodes that collapse dims for single-frame videos."],"tags":["seedvr","latent","tensor-shape","chunking","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}