Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Replace use of .view with .reshape (#4522)

Svein Ove Aas5f5026308834
diff --git a/comfy/ops.py b/comfy/ops.py
index d1038edb9..bd84a804c 100644
--- a/comfy/ops.py
+++ b/comfy/ops.py
@@ -250,7 +250,7 @@ def fp8_linear(self, input):
return None
if len(input.shape) == 3:
- inn = input.view(-1, input.shape[2]).to(dtype)
+ inn = input.reshape(-1, input.shape[2]).to(dtype)
non_blocking = comfy.model_management.device_supports_non_blocking(input.device)
w = cast_to(self.weight, device=input.device, non_blocking=non_blocking).t()
@@ -259,7 +259,7 @@ def fp8_linear(self, input):
else:
o, _ = torch._scaled_mm(inn, w, out_dtype=input.dtype)
- return o.view((-1, input.shape[1], self.weight.shape[0]))
+ return o.reshape((-1, input.shape[1], self.weight.shape[0]))
return None
class fp8_ops(manual_cast):