From 3e56fbc32c51f11c2b4e53fabde52c846a00d702 Mon Sep 17 00:00:00 2001 From: Daniel Maddern Date: Thu, 13 Aug 2026 21:29:52 +0700 Subject: [PATCH] Match Comfy BF16 latent packing --- src/h3_blackwell_runtime/packing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/h3_blackwell_runtime/packing.py b/src/h3_blackwell_runtime/packing.py index e34f9b1..a92fe20 100644 --- a/src/h3_blackwell_runtime/packing.py +++ b/src/h3_blackwell_runtime/packing.py @@ -72,8 +72,8 @@ class H3PromptPacker: text_rows = text[0].to(torch.bfloat16) else: raise ValueError("H3 text states must be Qwen 5120-wide or refined 5376-wide.") - video_rows = functional.linear(patchify_video(video).float(), self.video_weight, self.video_bias).to(torch.bfloat16) - audio_rows = functional.linear(pack_audio(audio).float(), self.audio_weight, self.audio_bias).to(torch.bfloat16) + video_rows = functional.linear(patchify_video(video.to(torch.bfloat16)).float(), self.video_weight, self.video_bias).to(torch.bfloat16) + audio_rows = functional.linear(pack_audio(audio.to(torch.bfloat16)).float(), self.audio_weight, self.audio_bias).to(torch.bfloat16) text_length, audio_length = text_rows.shape[0], audio_rows.shape[0] hidden = torch.cat((text_rows, audio_rows, video_rows)) video_sigma = torch.tensor(float(sigma), device=hidden.device).clamp(min=1e-6)