From 101644cc42d39187dfa1109db4594688500045e8 Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Mon, 5 Jan 2026 00:38:00 -0800 Subject: [PATCH] Make sure empty 3d tensors get reshaped correctly --- comfy/ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy/ops.py b/comfy/ops.py index 81ba69f6d..7e34831e0 100644 --- a/comfy/ops.py +++ b/comfy/ops.py @@ -437,7 +437,7 @@ def fp8_linear(self, input): uncast_bias_weight(self, w, bias, offload_stream) if tensor_3d: - o = o.reshape((-1, input_shape[1], w.shape[0])) + o = o.reshape((input_shape[0], input_shape[1], w.shape[0])) return o @@ -676,7 +676,7 @@ def mixed_precision_ops(quant_config={}, compute_dtype=torch.bfloat16, full_prec # Reshape output back to 3D if input was 3D if tensor_3d: - output = output.reshape((-1, input_shape[1], self.weight.shape[0])) + output = output.reshape((input_shape[0], input_shape[1], self.weight.shape[0])) return output