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_conditioningView on GitHub (pinned to 1c6d8d45b3)
Solutions
- Encode with the SeedVR2 video VAE so the latent is 5-D (B, C, T, H, W) before connecting SeedVR2Conditioning.
- Check the wire: the input must come from the video-VAE encode node, not a standard image VAE Encode.
- 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
- Use the SeedVR2 video VAE encode node, never an image VAE Encode.
- Check ndim == 5 and channel count == 16 before wiring conditioning.
- Keep video latents 5-D end to end; don't squeeze the temporal dim.
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
- SeedVR2TemporalChunk: expected a 5-D video latent (B, C, T,
- SeedVR2Preprocess expected at least one frame.
- {node_name}: expected 4-D or 5-D IMAGE tensor, got shape {tu
- {node_name}: input shorter edge must be at least 2 pixels; g
- SeedVR2PostProcessing: expected 4-D or 5-D IMAGE tensor, got
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/34b6abe82b1c778d.
Report an issue: GitHub.