Comfy-Org/ComfyUI · error · ValueError

SeedVR2Conditioning expects a 5-D VAE latent in Comfy channe

Error message

SeedVR2Conditioning expects a 5-D VAE latent in Comfy channel-first layout; got shape {tuple(vae_conditioning.shape)}.

What it means

SeedVR2Conditioning.execute expects the incoming VAE latent (from vae_conditioning['samples']) to be 5-D, matching Comfy's channel-first video-latent layout (B, C, T, H, W). A 3-D or 4-D tensor — typically a still-image latent (B, C, H, W) — is rejected with the actual shape.

Source

Thrown at comfy_extras/nodes_seedvr.py:387

            category="model/conditioning",
            description="Build SeedVR2 positive/negative conditioning from a VAE latent.",
            search_aliases=["seedvr2", "upscale", "conditioning"],
            inputs=[
                io.Model.Input("model", tooltip="The SeedVR2 model."),
                io.Latent.Input("vae_conditioning", display_name="latent"),
            ],
            outputs=[
                io.Conditioning.Output(display_name="positive", tooltip="The positive conditioning for sampling."),
                io.Conditioning.Output(display_name="negative", tooltip="The negative conditioning for sampling."),
            ],
        )

    @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

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Encode with the SeedVR2 video VAE so the latent is 5-D (B, C, T, H, W) before connecting SeedVR2Conditioning.
  2. Check the wire: the input must come from the video-VAE encode node, not a standard image VAE Encode.
  3. In scripts, verify latent.ndim == 5 before calling; unsqueeze the temporal dim only if you truly have a 1-frame video latent.

Example fix

# before
latent = image_vae.encode(image)        # 4-D (B,C,H,W) -> error
cond = SeedVR2Conditioning.execute(model, latent)

# after
latent = seedvr_vae.encode(video)        # 5-D (B,C,T,H,W)
cond = SeedVR2Conditioning.execute(model, latent)
Defensive patterns

Strategy: type-guard

Validate before calling

samples = vae_conditioning['samples']
if samples.ndim != 5:
    raise ValueError(f'need 5-D video latent, got {tuple(samples.shape)}; encode with the SeedVR2 video VAE')

Type guard

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

Prevention

When it happens

Trigger: Connecting a standard image VAE encode (4-D latent) instead of a video VAE encode to the SeedVR2 conditioning node; or a 3-D latent from custom code.

Common situations: Using the wrong VAE node (image VAE Encode instead of the SeedVR2/Bytedance video VAE); wiring a checkpoint's image-latent pipeline into the SeedVR2 video path; mixing node sets from a partially-updated ComfyUI.

Related errors


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