{"record":{"id":"34b6abe82b1c778d","repo":"Comfy-Org/ComfyUI","slug":"seedvr2conditioning-expects-a-5-d-vae-latent-in-co","errorCode":null,"errorMessage":"SeedVR2Conditioning expects a 5-D VAE latent in Comfy channel-first layout; got shape {tuple(vae_conditioning.shape)}.","messagePattern":"SeedVR2Conditioning expects a 5-D VAE latent in Comfy channel-first layout; got shape (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_seedvr.py","lineNumber":387,"sourceCode":"            category=\"model/conditioning\",\n            description=\"Build SeedVR2 positive/negative conditioning from a VAE latent.\",\n            search_aliases=[\"seedvr2\", \"upscale\", \"conditioning\"],\n            inputs=[\n                io.Model.Input(\"model\", tooltip=\"The SeedVR2 model.\"),\n                io.Latent.Input(\"vae_conditioning\", display_name=\"latent\"),\n            ],\n            outputs=[\n                io.Conditioning.Output(display_name=\"positive\", tooltip=\"The positive conditioning for sampling.\"),\n                io.Conditioning.Output(display_name=\"negative\", tooltip=\"The negative conditioning for sampling.\"),\n            ],\n        )\n\n    @classmethod\n    def execute(cls, model, vae_conditioning) -> io.NodeOutput:\n\n        vae_conditioning = vae_conditioning[\"samples\"]\n        if vae_conditioning.ndim != 5:\n            raise ValueError(\n                \"SeedVR2Conditioning expects a 5-D VAE latent in Comfy \"\n                f\"channel-first layout; got shape {tuple(vae_conditioning.shape)}.\"\n            )\n        if vae_conditioning.shape[1] != SEEDVR2_LATENT_CHANNELS:\n            if vae_conditioning.shape[-1] == SEEDVR2_LATENT_CHANNELS:\n                raise ValueError(\n                    \"SeedVR2Conditioning expects SeedVR2 VAE latents in Comfy \"\n                    f\"channel-first layout (B, {SEEDVR2_LATENT_CHANNELS}, T, H, W); \"\n                    f\"got channel-last shape {tuple(vae_conditioning.shape)}.\"\n                )\n            raise ValueError(\n                \"SeedVR2Conditioning expects SeedVR2 VAE latents with \"\n                f\"{SEEDVR2_LATENT_CHANNELS} channels; got shape {tuple(vae_conditioning.shape)}.\"\n            )\n        vae_conditioning = vae_conditioning.movedim(1, -1).contiguous()\n        model = _resolve_seedvr2_diffusion_model(model)\n        pos_cond = model.positive_conditioning\n        neg_cond = model.negative_conditioning","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_seedvr.py#L369-L405","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\nlatent = image_vae.encode(image)        # 4-D (B,C,H,W) -> error\ncond = SeedVR2Conditioning.execute(model, latent)\n\n# after\nlatent = seedvr_vae.encode(video)        # 5-D (B,C,T,H,W)\ncond = SeedVR2Conditioning.execute(model, latent)","handlingStrategy":"type-guard","validationCode":"samples = vae_conditioning['samples']\nif samples.ndim != 5:\n    raise ValueError(f'need 5-D video latent, got {tuple(samples.shape)}; encode with the SeedVR2 video VAE')","typeGuard":"def is_seedvr_video_latent(samples) -> bool:\n    return samples.ndim == 5 and samples.shape[1] == 16","tryCatchPattern":null,"preventionTips":["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."],"tags":["seedvr","latent","tensor-shape","vae","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}