Comfy-Org/ComfyUI · error · ValueError

SeedVR2Conditioning expects SeedVR2 VAE latents with {SEEDVR

Error message

SeedVR2Conditioning expects SeedVR2 VAE latents with {SEEDVR2_LATENT_CHANNELS} channels; got shape {tuple(vae_conditioning.shape)}.

What it means

The catch-all channel check in SeedVR2Conditioning: the latent is 5-D but neither dim 1 nor the last dim equals SEEDVR2_LATENT_CHANNELS (16). The latent therefore has the wrong channel count for the SeedVR2 VAE no matter the layout, and the shape is reported for diagnosis.

Source

Thrown at comfy_extras/nodes_seedvr.py:398

        )

    @classmethod
    def execute(cls, model, vae_conditioning) -> io.NodeOutput:

        vae_conditioning = vae_conditioning["samples"]
        if vae_conditioning.ndim != 5:
            raise ValueError(
                "SeedVR2Conditioning expects a 5-D VAE latent in Comfy "
                f"channel-first layout; got shape {tuple(vae_conditioning.shape)}."
            )
        if vae_conditioning.shape[1] != SEEDVR2_LATENT_CHANNELS:
            if vae_conditioning.shape[-1] == SEEDVR2_LATENT_CHANNELS:
                raise ValueError(
                    "SeedVR2Conditioning expects SeedVR2 VAE latents in Comfy "
                    f"channel-first layout (B, {SEEDVR2_LATENT_CHANNELS}, T, H, W); "
                    f"got channel-last shape {tuple(vae_conditioning.shape)}."
                )
            raise ValueError(
                "SeedVR2Conditioning expects SeedVR2 VAE latents with "
                f"{SEEDVR2_LATENT_CHANNELS} channels; got shape {tuple(vae_conditioning.shape)}."
            )
        vae_conditioning = vae_conditioning.movedim(1, -1).contiguous()
        model = _resolve_seedvr2_diffusion_model(model)
        pos_cond = model.positive_conditioning
        neg_cond = model.negative_conditioning

        mask = vae_conditioning.new_ones(vae_conditioning.shape[:-1] + (1,))
        condition = torch.cat((vae_conditioning, mask), dim=-1)
        condition = condition.movedim(-1, 1)

        negative = [[neg_cond.unsqueeze(0), {"condition": condition}]]
        positive = [[pos_cond.unsqueeze(0), {"condition": condition}]]

        return io.NodeOutput(positive, negative)

def _seedvr2_chunk_crossfade_weights(overlap, device, dtype):

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Encode with the SeedVR2 video VAE so the latent has exactly 16 channels in dim 1.
  2. Check that the VAE checkpoint loaded is the SeedVR2 one shipped with the model, not a default SD VAE.
  3. Print latent.shape in the feeding node: it must be (B, 16, T, H, W).
Defensive patterns

Strategy: validation

Validate before calling

samples = vae_conditioning['samples']
if not (samples.ndim == 5 and 16 in (samples.shape[1],)):
    raise ValueError(f'wrong VAE latent: {tuple(samples.shape)}; SeedVR2 needs (B,16,T,H,W)')

Type guard

def is_seedvr_latent_shape(s) -> bool:
    return s.ndim == 5 and s.shape[1] == 16

Prevention

When it happens

Trigger: Feeding a 5-D latent with a non-16 channel dimension — e.g. a standard SD/SDXL image VAE latent (4 channels) unsqueezed to 5-D, a Wan/other video VAE latent (16 or 48 channels depending on family), or a mismatched SeedVR2 VAE version.

Common situations: Mixing model families: wiring a non-SeedVR2 VAE encode or another model's video latent into the SeedVR2 conditioning node; loading mismatched SeedVR2 VAE weights.

Related errors


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