{"record":{"id":"bd28dea27b07ed4f","repo":"Comfy-Org/ComfyUI","slug":"temperature-temperature-is-not-supported","errorCode":null,"errorMessage":"Temperature {temperature} is not supported.","messagePattern":"Temperature (.+?) is not supported\\.","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/genmo/vae/model.py","lineNumber":555,"sourceCode":"            mean: Mean of the distribution. Shape: [B, C, T, H, W].\n            logvar: Logarithm of variance of the distribution. Shape: [B, C, T, H, W].\n        \"\"\"\n        assert mean.shape == logvar.shape\n        self.mean = mean\n        self.logvar = logvar\n\n    def sample(self, temperature=1.0, generator: torch.Generator = None, noise=None):\n        if temperature == 0.0:\n            return self.mean\n\n        if noise is None:\n            noise = torch.randn(self.mean.shape, device=self.mean.device, dtype=self.mean.dtype, generator=generator)\n        else:\n            assert noise.device == self.mean.device\n            noise = noise.to(self.mean.dtype)\n\n        if temperature != 1.0:\n            raise NotImplementedError(f\"Temperature {temperature} is not supported.\")\n\n        # Just Gaussian sample with no scaling of variance.\n        return noise * torch.exp(self.logvar * 0.5) + self.mean\n\n    def mode(self):\n        return self.mean\n\nclass Encoder(nn.Module):\n    def __init__(\n        self,\n        *,\n        in_channels: int,\n        base_channels: int,\n        channel_multipliers: List[int],\n        num_res_blocks: List[int],\n        latent_dim: int,\n        temporal_reductions: List[int],\n        spatial_reductions: List[int],","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/genmo/vae/model.py#L537-L573","documentation":"The genmo (Mochi) VAE's DiagonalGaussian posterior supports only three sampling modes: temperature 0.0 (deterministic mean), 1.0 (standard Gaussian sample), or a caller-supplied noise tensor with temperature 1.0 behavior. Any other temperature raises NotImplementedError because variance scaling for intermediate temperatures was not ported.","triggerScenarios":"Calling posterior.sample(temperature=0.7) or any value other than 0.0/1.0 during VAE encode sampling; note temperature==0.0 returns early and the raise only fires for values strictly between or above.","commonSituations":"Porting sampling code from other VAE implementations that expose continuous temperature controls; custom nodes exposing a temperature slider for the Mochi VAE.","solutions":["Use temperature=1.0 for stochastic sampling or temperature=0.0 for the deterministic mean.","If you need intermediate scaling, apply it yourself: z = posterior.sample(1.0); z = posterior.mean + temperature * (z - posterior.mean).","Remove/avoid exposing a temperature control for this VAE in custom nodes."],"exampleFix":"# before\nz = posterior.sample(temperature=0.8)\n\n# after\nz = posterior.sample(temperature=1.0)\nz = posterior.mean + 0.8 * (z - posterior.mean)  # manual temperature scaling","handlingStrategy":"validation","validationCode":"assert temperature in (0.0, 1.0), f\"genmo VAE sample supports temperature 0.0 or 1.0 only, got {temperature}\"","typeGuard":"def is_supported_genmo_temperature(t: float) -> bool:\n    return t in (0.0, 1.0)","tryCatchPattern":null,"preventionTips":["Do not expose a continuous temperature control for this VAE.","Implement custom temperature scaling on top of sample(1.0) output if needed."],"tags":["mochi","genmo","vae","not-implemented"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}