{"record":{"id":"32c38f47a2608002","repo":"sgl-project/sglang","slug":"unsupported-latent-log-var-latent-log-var","errorCode":null,"errorMessage":"Unsupported latent_log_var: {latent_log_var}","messagePattern":"Unsupported latent_log_var: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/vaes/ltx_2_3_condition_encoder.py","lineNumber":168,"sourceCode":"            )\n            block, feature_channels = _make_ltx23_encoder_block(\n                block_name=block_name,\n                block_config=block_config,\n                in_channels=feature_channels,\n                spatial_padding_mode=spatial_padding_mode,\n            )\n            self.down_blocks.append(block)\n\n        self.conv_norm_out = LTX23VideoPixelNorm(dim=1, eps=1e-8)\n        self.conv_act = nn.SiLU()\n\n        conv_out_channels = latent_channels\n        if latent_log_var == \"per_channel\":\n            conv_out_channels *= 2\n        elif latent_log_var in {\"uniform\", \"constant\"}:\n            conv_out_channels += 1\n        elif latent_log_var != \"none\":\n            raise ValueError(f\"Unsupported latent_log_var: {latent_log_var}\")\n\n        self.conv_out = LTX2VideoCausalConv3d(\n            in_channels=feature_channels,\n            out_channels=conv_out_channels,\n            kernel_size=3,\n            stride=1,\n            spatial_padding_mode=spatial_padding_mode,\n        )\n\n    def forward(self, sample: torch.Tensor) -> torch.Tensor:\n        frames_count = int(sample.shape[2])\n        if (frames_count - 1) % 8 != 0:\n            frames_to_crop = (frames_count - 1) % 8\n            sample = sample[:, :, :-frames_to_crop, ...]\n\n        hidden_states = _patchify_video(sample, self.patch_size)\n        hidden_states = self.conv_in(hidden_states, causal=True)\n","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/vaes/ltx_2_3_condition_encoder.py#L150-L186","documentation":"The LTX-2.3 condition encoder sizes its conv_out head according to latent_log_var: 'per_channel' doubles the channels, 'uniform'/'constant' add one channel, and 'none' leaves them unchanged. Any other string raises this ValueError in __init__.","triggerScenarios":"Constructing LTX2ConditionEncoder with latent_log_var set to something outside {per_channel, uniform, constant, none} — e.g. 'per-channel', 'disabled', None handled as a string, or a value from an incompatible checkpoint config.","commonSituations":"Loading a checkpoint whose config records a newer latent_log_var mode not supported by this sglang version; renaming/typo issues in converted configs; mixing diffusers LTX config keys with this implementation.","solutions":["Set latent_log_var to one of 'per_channel', 'uniform', 'constant', or 'none' in the config","Upgrade sglang if the checkpoint uses a newly introduced mode","If writing a custom config, copy the value verbatim from the official checkpoint's config"],"exampleFix":"// before\n\"latent_log_var\": \"per-channel\"\n\n// after\n\"latent_log_var\": \"per_channel\"","handlingStrategy":"validation","validationCode":"VALID_LOG_VAR = {'per_channel', 'uniform', 'constant', 'none'}\nassert cfg['latent_log_var'] in VALID_LOG_VAR, f\"latent_log_var must be one of {VALID_LOG_VAR}\"","typeGuard":"def is_valid_latent_log_var(v: str) -> bool:\n    return v in {'per_channel', 'uniform', 'constant', 'none'}","tryCatchPattern":null,"preventionTips":["Use the checkpoint's original latent_log_var value unchanged","Watch for spelling variants like 'per-channel' vs 'per_channel'","Upgrade sglang when loading newer LTX-2.3 checkpoints"],"tags":["python","value-error","model-config","ltx-2-3","latent-log-var"],"backgroundTag":"unsupported-config-option","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}