From 390135fca63357168271548d3ceade0b4768bd0c Mon Sep 17 00:00:00 2001 From: Daniel Maddern Date: Wed, 19 Aug 2026 21:07:34 +0700 Subject: [PATCH] Fix VAE pixel normalization in-place bug --- src/h3_blackwell_runtime/vae_encoder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/h3_blackwell_runtime/vae_encoder.py b/src/h3_blackwell_runtime/vae_encoder.py index d1d7dd9..c2aa87a 100644 --- a/src/h3_blackwell_runtime/vae_encoder.py +++ b/src/h3_blackwell_runtime/vae_encoder.py @@ -256,7 +256,8 @@ class MiniMaxH3VideoVAEEncoder(nn.Module): """``[B,3,H,W]`` or ``[B,3,T,H,W]`` pixels in ``[-1, 1]`` -> normalized latents ``[B,24,T_lat,H//16,W//16]``.""" if x.ndim == 4: x = x.unsqueeze(2) - x = x.add(1.0).mul_(0.5).sub_(self.pixel_mean.to(x)).div_(self.pixel_std.to(x)) + x = (x + 1.0) * 0.5 + x = (x - self.pixel_mean.to(x)) / self.pixel_std.to(x) if x.shape[2] == 1: moments = self._adaptive_encode(x)[:, :, -1:, :, :] else: