{"record":{"id":"48580d35471e5a04","repo":"Comfy-Org/ComfyUI","slug":"invalid-latent-log-var-latent-log-var","errorCode":null,"errorMessage":"Invalid latent_log_var: {latent_log_var}","messagePattern":"Invalid latent_log_var: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/lightricks/vae/causal_video_autoencoder.py","lineNumber":222,"sourceCode":"            self.conv_norm_out = nn.GroupNorm(\n                num_channels=output_channel, num_groups=norm_num_groups, eps=1e-6\n            )\n        elif norm_layer == \"pixel_norm\":\n            self.conv_norm_out = PixelNorm()\n        elif norm_layer == \"layer_norm\":\n            self.conv_norm_out = LayerNorm(output_channel, eps=1e-6)\n\n        self.conv_act = nn.SiLU()\n\n        conv_out_channels = out_channels\n        if latent_log_var == \"per_channel\":\n            conv_out_channels *= 2\n        elif latent_log_var == \"uniform\":\n            conv_out_channels += 1\n        elif latent_log_var == \"constant\":\n            conv_out_channels += 1\n        elif latent_log_var != \"none\":\n            raise ValueError(f\"Invalid latent_log_var: {latent_log_var}\")\n        self.conv_out = make_conv_nd(\n            dims,\n            output_channel,\n            conv_out_channels,\n            3,\n            padding=1,\n            causal=True,\n            spatial_padding_mode=spatial_padding_mode,\n        )\n\n        self.gradient_checkpointing = False\n\n    def _forward_chunk(self, sample: torch.FloatTensor) -> Optional[torch.FloatTensor]:\n        sample = self.conv_in(sample)\n\n        checkpoint_fn = (\n            partial(torch.utils.checkpoint.checkpoint, use_reentrant=False)\n            if self.gradient_checkpointing and self.training","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/lightricks/vae/causal_video_autoencoder.py#L204-L240","documentation":"Raised by the causal video autoencoder Encoder when latent_log_var is not one of 'per_channel', 'uniform', 'constant', or 'none'. This field selects how many extra output channels the final conv emits for the latent distribution's log variance; unrecognized values are rejected because output channel count would be ambiguous.","triggerScenarios":"Constructing Encoder(latent_log_var=\"per-channel\"), \"\", \"learned\", or any other string; typically the value comes straight from the checkpoint's config JSON.","commonSituations":"Checkpoint configs from newer LTX VAE variants that rename the option; typo or missing field defaulting incorrectly; porting configs between repos with different vocabularies.","solutions":["Set latent_log_var to one of 'none', 'per_channel', 'uniform', or 'constant'","Check the checkpoint's config JSON for the exact spelling of the field","Update ComfyUI if the checkpoint comes from a newer model that added a new mode"],"exampleFix":"# before\nEncoder(..., latent_log_var=\"per-channel\")\n\n# after\nEncoder(..., latent_log_var=\"per_channel\")","handlingStrategy":"validation","validationCode":"VALID_LOG_VAR = {\"none\", \"per_channel\", \"uniform\", \"constant\"}\nif cfg.get(\"latent_log_var\", \"none\") not in VALID_LOG_VAR:\n    raise ValueError(f\"latent_log_var must be one of {sorted(VALID_LOG_VAR)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whitelist latent_log_var values from checkpoint configs before building the Encoder","Default missing fields explicitly instead of passing raw config values through"],"tags":["config","encoder","video-vae","ltx"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}