{"record":{"id":"cfb14508eda99b53","repo":"Comfy-Org/ComfyUI","slug":"seedvr2-videoautoencoderklwrapper-decode-seedvr2","errorCode":null,"errorMessage":"SeedVR2 VideoAutoencoderKLWrapper.decode: `seedvr2_tiling` must be a dict; got {type(seedvr2_tiling).__name__} with value {seedvr2_tiling!r}.","messagePattern":"SeedVR2 VideoAutoencoderKLWrapper\\.decode: `seedvr2_tiling` must be a dict; got (.+?) with value (.+?)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/seedvr/vae.py","lineNumber":1473,"sourceCode":"        x = self.decode(z)\n        return x, z, p\n\n    def _encode_with_raw_latent(self, x):\n        if x.ndim == 4:\n            x = x.unsqueeze(2)\n        self.device = x.device\n        p = super().encode(x)\n        z = p.squeeze(2)\n        return z, p\n\n    def encode(self, x):\n        z, _ = self._encode_with_raw_latent(x)\n        return z\n\n    def decode(self, z, seedvr2_tiling=None):\n        seedvr2_tiling = {} if seedvr2_tiling is None else seedvr2_tiling\n        if not isinstance(seedvr2_tiling, dict):\n            raise RuntimeError(\n                \"SeedVR2 VideoAutoencoderKLWrapper.decode: `seedvr2_tiling` must be a dict; \"\n                f\"got {type(seedvr2_tiling).__name__} with value {seedvr2_tiling!r}.\"\n            )\n\n        if z.ndim == 5:\n            _, c, _, _, _ = z.shape\n            if c != SEEDVR2_LATENT_CHANNELS:\n                raise RuntimeError(\n                    \"SeedVR2 VideoAutoencoderKLWrapper.decode: 5-D latent input must \"\n                    f\"have {SEEDVR2_LATENT_CHANNELS} channels; got shape {tuple(z.shape)}.\"\n                )\n            latent = z\n        elif z.ndim == 4:\n            b, tc, h, w = z.shape\n            if tc % SEEDVR2_LATENT_CHANNELS != 0:\n                raise RuntimeError(\n                    \"SeedVR2 VideoAutoencoderKLWrapper.decode: 4-D latent input must \"\n                    f\"use collapsed channel layout (B, {SEEDVR2_LATENT_CHANNELS}*T, H, W); \"","sourceCodeStart":1455,"sourceCodeEnd":1491,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/seedvr/vae.py#L1455-L1491","documentation":"VideoAutoencoderKLWrapper.decode accepts an optional seedvr2_tiling argument that must be a dict of tiling options (or None, which is treated as {}). Any other type (string, bool, list, number) raises a RuntimeError because the code immediately calls .get() on it. The error message includes the offending type and value for easy diagnosis.","triggerScenarios":"Calling decode(z, seedvr2_tiling=True), decode(z, \"tiled\"), or passing a JSON-parsed value that is not an object.","commonSituations":"Treating tiling as a boolean flag; deserializing workflow JSON where seedvr2_tiling was saved as a string or list; forwarding an untyped UI combo value straight into decode.","solutions":["Pass a dict, e.g. decode(z, {\"enable_tiling\": True}) or omit the argument entirely.","If the value comes from parsed JSON or UI input, coerce/validate it to a dict before the call.","Enable tiling with the documented keys: decode(z, {\"enable_tiling\": True, ...tile params...})."],"exampleFix":"# before\nimg = vae.decode(latent, seedvr2_tiling=True)\n# after\nimg = vae.decode(latent, seedvr2_tiling={\"enable_tiling\": True})","handlingStrategy":"type-guard","validationCode":"if seedvr2_tiling is not None and not isinstance(seedvr2_tiling, dict):\n    raise TypeError(\"seedvr2_tiling must be a dict or None\")\nvae.decode(z, seedvr2_tiling=seedvr2_tiling)","typeGuard":"def is_tiling_opts(v) -> bool:\n    return v is None or isinstance(v, dict)","tryCatchPattern":"try:\n    out = vae.decode(z, seedvr2_tiling=opts)\nexcept RuntimeError as e:\n    if \"must be a dict\" in str(e):\n        opts = {\"enable_tiling\": bool(opts)} if not isinstance(opts, dict) else opts\n        out = vae.decode(z, seedvr2_tiling=opts)\n    else:\n        raise","preventionTips":["Treat seedvr2_tiling as an options dict, never a boolean flag.","Validate deserialized workflow JSON values before passing them to decode."],"tags":["seedvr","vae","decode","tiling","type-error"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}