{"record":{"id":"627d3e4d6e70cdba","repo":"sgl-project/sglang","slug":"sana-wm-streaming-decode-requires-autoencoderklcau","errorCode":null,"errorMessage":"SANA-WM streaming decode requires AutoencoderKLCausalLTX2Video (decode_chunk). Point --component_paths.vae at the ltx2_causal_vae weights when streaming.","messagePattern":"SANA-WM streaming decode requires AutoencoderKLCausalLTX2Video \\(decode_chunk\\)\\. Point --component_paths\\.vae at the ltx2_causal_vae weights when streaming\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/streaming.py","lineNumber":745,"sourceCode":"class SanaWMStreamingDecodingStage(DecodingStage):\n    \"\"\"Streaming causal-VAE decode over the SAME autoregressive grid the denoise stage used.\n\n    Carries a per-conv decoder cache across chunks so the causal LTX-2 VAE produces\n    seam-free frames (the `decode_per_frame_with_cache` equivalent at chunk granularity).\n    Subclasses DecodingStage directly (NOT SanaWMDecodingStage, whose long-video config\n    re-enables the stateless tiled decode).\n    \"\"\"\n\n    @torch.no_grad()\n    def decode(\n        self,\n        latents: torch.Tensor,\n        server_args: ServerArgs,\n        *,\n        vae_dtype: torch.dtype,\n    ) -> torch.Tensor:\n        if not hasattr(self.vae, \"decode_chunk\"):\n            raise ValueError(\n                \"SANA-WM streaming decode requires AutoencoderKLCausalLTX2Video \"\n                \"(decode_chunk). Point --component_paths.vae at the ltx2_causal_vae \"\n                \"weights when streaming.\"\n            )\n        device = get_local_torch_device()\n        latents = latents.to(device)\n        pcfg = server_args.pipeline_config\n        num_frame_per_block = int(getattr(pcfg, \"num_frame_per_block\", 3))\n        total_frames = latents.shape[2]\n        segments = SanaWMStreamingDenoisingStage._autoregressive_segments(\n            total_frames, num_frame_per_block\n        )\n        conv_cache = self.vae.reset_decoder_cache()\n        chunks = []\n        for i in range(len(segments) - 1):\n            s, e = segments[i], segments[i + 1]\n            z = self.scale_and_shift(latents[:, :, s:e].to(vae_dtype), server_args)\n            # No autocast: match the official decode (VAE already runs in vae_dtype,","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/streaming.py#L727-L763","documentation":"Streaming decode requires the LTX-2 causal video VAE (AutoencoderKLCausalLTX2Video) because it decodes via decode_chunk for causally-consistent chunked decoding. If the loaded VAE object lacks decode_chunk (e.g. a standard KL VAE), the stage raises with the remedy: point --component_paths.vae at the ltx2_causal_vae weights.","triggerScenarios":"Launching a streaming SANA-WM pipeline with the default/non-causal VAE weights, or a component override that swapped in a generic AutoencoderKL.","commonSituations":"Reusing a dense-path config (standard VAE) for streaming; missing ltx2_causal_vae checkpoint locally so a fallback VAE loaded; typo in --component_paths.vae path silently falling back.","solutions":["Set --component_paths.vae to the ltx2_causal_vae weights for streaming runs","Verify the loaded object is AutoencoderKLCausalLTX2Video (hasattr(vae, 'decode_chunk'))","Download/place the causal VAE checkpoint and restart the server"],"exampleFix":"# before\npython -m sglang.launch_server --model sana-wm ...  # default VAE\n# after\npython -m sglang.launch_server --model sana-wm \\\n  --component_paths.vae /path/to/ltx2_causal_vae","handlingStrategy":"validation","validationCode":"assert hasattr(vae, \"decode_chunk\"), \"load ltx2_causal_vae via --component_paths.vae for streaming\"","typeGuard":"def is_causal_video_vae(vae) -> bool:\n    return hasattr(vae, \"decode_chunk\")","tryCatchPattern":"null","preventionTips":["Set --component_paths.vae to ltx2_causal_vae weights for streaming deployments","Startup-check hasattr(vae, 'decode_chunk') when streaming is enabled","Keep dense and streaming component sets in separate named configs"],"tags":["sana-wm","streaming","vae","component-paths","ltx2"],"backgroundTag":"wrong-component-loaded","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}