Comfy-Org/ComfyUI · error · ValueError

SeedVR2TemporalMerge: temporal_overlap must be >= 0; got {te

Error message

SeedVR2TemporalMerge: temporal_overlap must be >= 0; got {temporal_overlap}.

What it means

SeedVR2TemporalMerge.execute takes temporal_overlap from the latents' paired Int output (temporal_overlap[0], force_input so APIs can pass anything). A negative overlap would corrupt the merge-step arithmetic, so it is rejected up front with this message.

Source

Thrown at comfy_extras/nodes_seedvr.py:541

            category="model/latent/batch",
            is_input_list=True,
            description="Recombine sampled SeedVR2 latent temporal chunks into one latent, crossfading each overlap with a Hann window sized by the temporal_overlap wired from Split SeedVR2 Latent.",
            search_aliases=["seedvr2", "merge", "temporal", "hann", "crossfade"],
            inputs=[
                io.Latent.Input("latents", tooltip="The sampled temporal chunks in sequence order."),
                io.Int.Input("temporal_overlap", default=0, min=0, max=16384, force_input=True,
                             tooltip="The temporal_overlap output of Split SeedVR2 Latent. 0 = plain concatenation."),
            ],
            outputs=[
                io.Latent.Output(display_name="latent", tooltip="The recombined full-length latent."),
            ],
        )

    @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 "

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Pass the temporal_overlap value that the paired SeedVR2TemporalChunk node output, unmodified.
  2. Clamp before queueing: max(0, overlap).
  3. Keep split and merge nodes' overlap values in sync — the merge must use the split's reported effective overlap.

Example fix

# before
merge_inputs = {'temporal_overlap': split_overlap - 1}  # -1 when split_overlap == 0

# after
merge_inputs = {'temporal_overlap': split_overlap}
Defensive patterns

Strategy: validation

Validate before calling

temporal_overlap = max(0, int(latents_overlap_value))
if temporal_overlap < 0:
    raise ValueError('temporal_overlap must be >= 0')

Type guard

def is_valid_merge_overlap(v) -> bool:
    return isinstance(v, int) and v >= 0

Prevention

When it happens

Trigger: Calling the merge node via the API with temporal_overlap < 0, or wiring a computed integer that went negative (e.g. overlap - 1 when overlap was 0).

Common situations: Programmatic workflows that derive overlap from the split node's output and subtract a margin; mismatched split/merge parameter pairs; hand-edited workflow JSON.

Related errors


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