{"record":{"id":"6f3cad01de4d1673","repo":"Comfy-Org/ComfyUI","slug":"seedvr2conditioning-expects-seedvr2-vae-latents-wi","errorCode":null,"errorMessage":"SeedVR2Conditioning expects SeedVR2 VAE latents with {SEEDVR2_LATENT_CHANNELS} channels; got shape {tuple(vae_conditioning.shape)}.","messagePattern":"SeedVR2Conditioning expects SeedVR2 VAE latents with (.+?) channels; got shape (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_seedvr.py","lineNumber":398,"sourceCode":"        )\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\n\n        mask = vae_conditioning.new_ones(vae_conditioning.shape[:-1] + (1,))\n        condition = torch.cat((vae_conditioning, mask), dim=-1)\n        condition = condition.movedim(-1, 1)\n\n        negative = [[neg_cond.unsqueeze(0), {\"condition\": condition}]]\n        positive = [[pos_cond.unsqueeze(0), {\"condition\": condition}]]\n\n        return io.NodeOutput(positive, negative)\n\ndef _seedvr2_chunk_crossfade_weights(overlap, device, dtype):","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_seedvr.py#L380-L416","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Encode with the SeedVR2 video VAE so the latent has exactly 16 channels in dim 1.","Check that the VAE checkpoint loaded is the SeedVR2 one shipped with the model, not a default SD VAE.","Print latent.shape in the feeding node: it must be (B, 16, T, H, W)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"samples = vae_conditioning['samples']\nif not (samples.ndim == 5 and 16 in (samples.shape[1],)):\n    raise ValueError(f'wrong VAE latent: {tuple(samples.shape)}; SeedVR2 needs (B,16,T,H,W)')","typeGuard":"def is_seedvr_latent_shape(s) -> bool:\n    return s.ndim == 5 and s.shape[1] == 16","tryCatchPattern":null,"preventionTips":["Encode only with the SeedVR2 VAE checkpoint shipped with the model.","Never mix SD/Wan latents into the SeedVR2 chain.","Print samples.shape once when wiring a new workflow."],"tags":["seedvr","latent","channels","validation","model-mismatch"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}