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.

quant ops: Dequantize weight in-place (#10935)

rattus3f382a4f9884
diff --git a/comfy/quant_ops.py b/comfy/quant_ops.py
index d2f3e7397..9b924560b 100644
--- a/comfy/quant_ops.py
+++ b/comfy/quant_ops.py
@@ -425,7 +425,8 @@ class TensorCoreFP8Layout(QuantizedLayout):
@staticmethod
def dequantize(qdata, scale, orig_dtype, **kwargs):
plain_tensor = torch.ops.aten._to_copy.default(qdata, dtype=orig_dtype)
- return plain_tensor * scale
+ plain_tensor.mul_(scale)
+ return plain_tensor
@classmethod
def get_plain_tensors(cls, qtensor):