Comfy-Org/ComfyUI · error · ValueError

SeedVR2TemporalMerge: chunk {i} shape {tuple(chunk.shape)} d

Error message

SeedVR2TemporalMerge: chunk {i} shape {tuple(chunk.shape)} does not match chunk 0 shape {tuple(first.shape)} outside the temporal axis.

What it means

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.

Source

Thrown at comfy_extras/nodes_seedvr.py:553

        )

    @classmethod
    def execute(cls, latents, temporal_overlap) -> io.NodeOutput:
        temporal_overlap = temporal_overlap[0]
        if temporal_overlap < 0:
            raise ValueError(
                f"SeedVR2TemporalMerge: temporal_overlap must be >= 0; got {temporal_overlap}."
            )
        chunks = [entry["samples"] for entry in latents]
        first = chunks[0]
        if first.ndim != 5:
            raise ValueError(
                f"SeedVR2TemporalMerge: expected 5-D video latents (B, C, T, H, W); "
                f"chunk 0 has shape {tuple(first.shape)}."
            )
        for i, chunk in enumerate(chunks[1:], start=1):
            if chunk.shape[:2] != first.shape[:2] or chunk.shape[3:] != first.shape[3:]:
                raise ValueError(
                    f"SeedVR2TemporalMerge: chunk {i} shape {tuple(chunk.shape)} does not "
                    f"match chunk 0 shape {tuple(first.shape)} outside the temporal axis."
                )
            if i < len(chunks) - 1 and chunk.shape[2] != first.shape[2]:
                raise ValueError(
                    f"SeedVR2TemporalMerge: chunk {i} has {chunk.shape[2]} latent frames but "
                    f"chunk 0 has {first.shape[2]}; only the final chunk may be shorter."
                )

        out = latents[0].copy()
        out.pop("noise_mask", None)

        if len(chunks) == 1:
            out["samples"] = first
            return io.NodeOutput(out)
        if temporal_overlap == 0:
            out["samples"] = torch.cat(chunks, dim=2)
            return io.NodeOutput(out)

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Regenerate all chunks with identical width, height, batch size, and the same VAE
  2. Check the reported shapes in the message and fix the outlier chunk's generating node settings
  3. Verify chunks all come from the same SeedVR2 video pipeline
Defensive patterns

Strategy: validation

Validate before calling

first = chunks[0]
for i, c in enumerate(chunks[1:], 1):
    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)}"

Try / catch

try:
    out = SeedVR2TemporalMerge.execute(latents, overlap)
except ValueError as e:
    if "does not match chunk 0" in str(e):
        # regenerate mismatched chunk with chunk 0's resolution/VAE
        ...

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/c4d5ad120c0e9c8b. Report an issue: GitHub.