{"record":{"id":"c4d5ad120c0e9c8b","repo":"Comfy-Org/ComfyUI","slug":"seedvr2temporalmerge-chunk-i-shape-tuple-chunk","errorCode":null,"errorMessage":"SeedVR2TemporalMerge: chunk {i} shape {tuple(chunk.shape)} does not match chunk 0 shape {tuple(first.shape)} outside the temporal axis.","messagePattern":"SeedVR2TemporalMerge: chunk (.+?) shape (.+?) does not match chunk 0 shape (.+?) outside the temporal axis\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_seedvr.py","lineNumber":553,"sourceCode":"        )\n\n    @classmethod\n    def execute(cls, latents, temporal_overlap) -> io.NodeOutput:\n        temporal_overlap = temporal_overlap[0]\n        if temporal_overlap < 0:\n            raise ValueError(\n                f\"SeedVR2TemporalMerge: temporal_overlap must be >= 0; got {temporal_overlap}.\"\n            )\n        chunks = [entry[\"samples\"] for entry in latents]\n        first = chunks[0]\n        if first.ndim != 5:\n            raise ValueError(\n                f\"SeedVR2TemporalMerge: expected 5-D video latents (B, C, T, H, W); \"\n                f\"chunk 0 has shape {tuple(first.shape)}.\"\n            )\n        for i, chunk in enumerate(chunks[1:], start=1):\n            if chunk.shape[:2] != first.shape[:2] or chunk.shape[3:] != first.shape[3:]:\n                raise ValueError(\n                    f\"SeedVR2TemporalMerge: chunk {i} shape {tuple(chunk.shape)} does not \"\n                    f\"match chunk 0 shape {tuple(first.shape)} outside the temporal axis.\"\n                )\n            if i < len(chunks) - 1 and chunk.shape[2] != first.shape[2]:\n                raise ValueError(\n                    f\"SeedVR2TemporalMerge: chunk {i} has {chunk.shape[2]} latent frames but \"\n                    f\"chunk 0 has {first.shape[2]}; only the final chunk may be shorter.\"\n                )\n\n        out = latents[0].copy()\n        out.pop(\"noise_mask\", None)\n\n        if len(chunks) == 1:\n            out[\"samples\"] = first\n            return io.NodeOutput(out)\n        if temporal_overlap == 0:\n            out[\"samples\"] = torch.cat(chunks, dim=2)\n            return io.NodeOutput(out)","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_seedvr.py#L535-L571","documentation":"When merging temporal chunks, every chunk after the first must match chunk 0 in batch, channel, height, and width (all axes except the temporal axis T). This check runs before torch.cat/chunk blending so mismatched chunks fail fast with a clear message instead of producing a cryptic cat error or corrupted output.","triggerScenarios":"Calling SeedVR2TemporalMerge with chunks whose B, C, H, or W differ — e.g. chunk 0 encoded at 1920x1080 and chunk 1 at 1280x720, or chunks from different VAEs with different channel counts, or batch size changed between chunk generations.","commonSituations":"Generating video chunks in separate sessions with different resolution settings; mixing latents from different models/VAEs (channel mismatch); manually collecting chunk latents from multiple workflow runs where width/height sliders differed.","solutions":["Regenerate all chunks with identical width, height, batch size, and the same VAE","Check the reported shapes in the message and fix the outlier chunk's generating node settings","Verify chunks all come from the same SeedVR2 video pipeline"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"first = chunks[0]\nfor i, c in enumerate(chunks[1:], 1):\n    assert c.shape[:2] == first.shape[:2] and c.shape[3:] == first.shape[3:], f\"chunk {i} mismatch: {tuple(c.shape)} vs {tuple(first.shape)}\"","typeGuard":null,"tryCatchPattern":"try:\n    out = SeedVR2TemporalMerge.execute(latents, overlap)\nexcept ValueError as e:\n    if \"does not match chunk 0\" in str(e):\n        # regenerate mismatched chunk with chunk 0's resolution/VAE\n        ...","preventionTips":["Generate all chunks in one session with locked width/height/batch settings","Use one VAE for every chunk"],"tags":["seedvr","video","latents","shape-mismatch"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}